-
Split String
Hello Everybody:
I have a string called
CIC Server kshah|345678 StatusChange PhoneStatus Change.
How do I use the String.Split method so that the entire string splits and get stored in an array as:
xmlarry[0]=CIC Server
xmlarry[1]=kshah|345678
xmlarry[2]=StatusChange
xmlarry[3]=PhoneStatus Change
Pls guide...
Thanks,
Rahil
-
It doesnt look like your string has any delimiters. Here is a link that may help you.
http://msdn.microsoft.com/library/de...SplitTopic.asp
-
Here is a working example that should get you rollin'
Code:
static void Main(string[] args)
{
string s = "CIC Server kshah|345678 StatusChange PhoneStatus Change";
string[] split = s.Split('|');
foreach (string z in split)
{
Console.WriteLine(z + "\n");
}
}