real simple question
-
ok this is vexing me i have a string like this: blahblahblahblah$blahblahblahblah$ notice is contains $ characters. i want to SPLIT this string using the $ as a delimiter. The string is stored in a CString (i'm using MFC). Can someone show me how I can tokenize this string. A SIMPLE example please!!! ARGH, thanks!!
-
ok this is vexing me i have a string like this: blahblahblahblah$blahblahblahblah$ notice is contains $ characters. i want to SPLIT this string using the $ as a delimiter. The string is stored in a CString (i'm using MFC). Can someone show me how I can tokenize this string. A SIMPLE example please!!! ARGH, thanks!!
CString buff("This is$my string");
for(int x=0; x<
Notice this only splits a string in half nothing more. It find the first $ character and copies anything left of it to a buffer and anything right of it to another buffer.
It would reauire a littel tweaking to split a string multiple times.
Cheers!
p.s-Ignore the << it should only be one...but I don't know the excape code in HTML for single angle brackets. Sorry!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
-
ok this is vexing me i have a string like this: blahblahblahblah$blahblahblahblah$ notice is contains $ characters. i want to SPLIT this string using the $ as a delimiter. The string is stored in a CString (i'm using MFC). Can someone show me how I can tokenize this string. A SIMPLE example please!!! ARGH, thanks!!
Use the undocumented function AfxExtractSubString().
int n = 0;
CString sToken;while ( AfxExtractSubString ( sToken, sBlahBlahString, n++, '$' ))
{
// do stuff with the token ...
}--Mike-- Best score on the mini-putt game: 26 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan and Jamie Salé.
-
Use the undocumented function AfxExtractSubString().
int n = 0;
CString sToken;while ( AfxExtractSubString ( sToken, sBlahBlahString, n++, '$' ))
{
// do stuff with the token ...
}--Mike-- Best score on the mini-putt game: 26 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan and Jamie Salé.
-
Use the undocumented function AfxExtractSubString().
int n = 0;
CString sToken;while ( AfxExtractSubString ( sToken, sBlahBlahString, n++, '$' ))
{
// do stuff with the token ...
}--Mike-- Best score on the mini-putt game: 26 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan and Jamie Salé.
Cool...that is easy! Thanx Mike! "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
-
Use the undocumented function AfxExtractSubString().
int n = 0;
CString sToken;while ( AfxExtractSubString ( sToken, sBlahBlahString, n++, '$' ))
{
// do stuff with the token ...
}--Mike-- Best score on the mini-putt game: 26 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan and Jamie Salé.
I wish we could rate these posts like you can at CodeGuru - what a helpful post!:laugh: