Monday, May 11, 2009

Split String in C#

public static string[] SplitString()
{
string str="|name;87,156|new_ic1;28,239|new_ic2;31,239,156|new_ic3;34,239|new_ic4;38,239|new_ic5;41,239.....|";

// char[] array for the separators
char[] separators = new char[] {'|', ',', ';', '.'};

// string[] array to store splitted valus

string[] values= new string[7];

values = str.Split(separators);

return values;


}

No comments:

Post a Comment

 
Locations of visitors to this page