Split the String with particular symbol

Sathya4260
Posted by Sathya4260 under C# category on | Points: 40 | Views : 2372
Hi,

Here is the code to use split method for string to split the statement with particular symbols like ,
Ex:
String namelist="sathish,karthick,prabha "

String[] names=namelist.split(', ');

Console.WriteLine(names[0]);
Console.WriteLine(names[1]);
Console.WriteLine(names[2]);

Output:

sathish
karthick
prabha

Comments or Responses

Login to post response