Google Brother Up

2008/12/19

Split a string separated by ";" and place in an array

How to split a string like this ";1;2;3;4;5;6" and put in on an array?

string mstrStream = mstrSelectedRowsStream.Remove(0,1); // to remove the semicolon on the extreme left

char chSep = ';';
string[] arrStr = mstrStream.Split(chSep);


How to get each number back from that array?

for (int i = 0; i <>
{
     string s = arrStr[i].ToString();
}

145 unique visitors

No comments:

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx