Jensen,
I would just use the Split method on the string itself, passing a
semicolon. It's probably going to give you the fastest performance.
However, I don't know that you should use a string at all. If the
string is rather large, you should be parsing it apart as you are retrieving
the information. For example, if the string was in a file, or being read
over a stream, I would parse it out as I read the characters from the
stream, not once the string was constructed.
If you got it from someplace else, like a database field (where it is in
string format already) and you can't do anything about it being in a string,
use the Split method.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Jensen bredal" <je************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,
I have a string formated in the following way:
s = 1;32;100;32;09;.........;09;76;
I need to extract the numbers separated by the seicolon.
The list can contain several thousands of items and the code is
time critical.
How can i best extract them in C#.
Many Thanks in advance
JB