question about CStringT::Tokenize
- From: "zhanglr" <zhanglr@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 9 Apr 2005 12:05:02 -0700
Hi,
I try to split a string "First,,Third" with ",". I suppose the result is
"First", "", and "Third". But why it is "First","Third".(A empty string has
been skipped.)
BTW, how about ",First,Second,Third" and "First,Second,Third,"
If CString::Tokenize cannot support it directly, any other way can do it
easily.
//code
CString str( "First,,Third" );
CString resToken;
int curPos= 0;
CString strSplitter( "," );
resToken= str.Tokenize(strSplitter,curPos);
while (resToken != "")
{
printf("Resulting token: %s\n", resToken);
resToken= str.Tokenize(strSplitter,curPos);
};
Best Regards,
ZHANG LIREN
.
- Prev by Date: Re: Problem downloading Activex control
- Next by Date: Re: Problem downloading Activex control
- Previous by thread: Missing linkage of resource
- Next by thread: Linker warning (oleaut32.dll)
- Index(es):