Am working on a project right now and almost stuck at a point. Say, I have a text document with contents like:abc,123.xyz;praise;end,file,clear
Now I want abc , 123 . xyz ; praise ... in an array. I used split method with array of characters. Though I retrieved abc,123,xyz,praise,end,file,clear I couldn't retrieve , . ; ; , , ,. I need every different characters in text file.
#region Splitting
string splitSamp = "abc,123.xyz;praise;end,file,clear";
string[] splitSampArr = splitSamp.Split(',','.',';');
string[] myText=new string[splitSamp.Length];
int i=0;
foreach (string splitSampArrVal in splitSampArr)
{
Console.WriteLine(splitSampArrVal);
myText[i]=splitSampArrVal;
i++;
}
for (i = 0; i < 10; i++)
{
Console.WriteLine(myText[i]);
}
#endregion
I imported the files to a rich text document control using file dialog. I want the the string in a variable say myText (it is an array)
myText[0]=abc
myText[1]=,
mytext[2]=123
myText[3]=.
myText[4]=xyz
and soon
Any help soon will be appreciated. Thanks!