Features


Tuesday, May 13, 2008

How to split in c#

private void SplitNo()
{
// string seperated by colons ';'
string items = "1--->;2--->;3--->;4--->;5--->";
string[] collection = new string[4];
// define which character is seperating fields
collection = items.Split(';');

for (int x = 0; x < collection.Length; x++) { Response.Write(collection[x] + "
");
}
}
-----------------------------------------------------------
Sample Output:

1--->
2--->
3--->
4--->
5--->

2 comments:

M said...

Copy paste tanan oh!! hehehehhe

Leslie C. Parba said...

watta!!