Maybe something along the lines of:
string NextToken (out string Tail, string Tokens, params char[] Separator)
{return NextToken (out Tail, Tokens, true, Separator) ;}
string NextToken (out string Tail, string Tokens, bool Trim, params char[]
Separator)
{
Tail = null ;
if (Tokens == null) return null ;
string [] Pieces = Tokens.Split (Separator, 2) ;
if (Pieces.Length > 1) Tail = Trim ? Pieces[1].Trim () : Pieces[1] ;
return Trim ? Pieces[0].Trim () : Pieces[0] ;
}
"James" <Ja***@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hi,
I am looking for a stringtokenizer class/method in C#, but can't find one.
The similar classes in Java and C++ are StringTokenizer and
CStringT::tokenize respectively. I need to keep a current position within
the
string and change the delimiters dynamically when going throught the
string.
Does anyone know a stringtokenizer in c#?
Thanks a lot,
James