Parsing a CString.
-
hi... I have a CString like CString str ="1,2,3,4,5,6"; now i want to retrieve each one as string like str1=1; str2=2; str3=3; here "," is delimeter. Even this is so simple... but i am not familier with CString methods. please help me in this regard Thanks in advance.... Regards varma.
-
hi... I have a CString like CString str ="1,2,3,4,5,6"; now i want to retrieve each one as string like str1=1; str2=2; str3=3; here "," is delimeter. Even this is so simple... but i am not familier with CString methods. please help me in this regard Thanks in advance.... Regards varma.
-
hi... I have a CString like CString str ="1,2,3,4,5,6"; now i want to retrieve each one as string like str1=1; str2=2; str3=3; here "," is delimeter. Even this is so simple... but i am not familier with CString methods. please help me in this regard Thanks in advance.... Regards varma.
See CString::Tokenize
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
See CString::Tokenize
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
Hi, you can do like this.
CString out = "1,2,3,4,5,6"; out.Replace(\_T(","), \_T("")); int len = out.GetLength(); for(int i=0;i<len;i++)> { String\[i\] = out.Mid(i,1); AfxMessageBox(String\[i\]); }
The price of anything is the amount of life you exchange for it. Thanks and Regards. SANTHOSH V
-
Hi, you can do like this.
CString out = "1,2,3,4,5,6"; out.Replace(\_T(","), \_T("")); int len = out.GetLength(); for(int i=0;i<len;i++)> { String\[i\] = out.Mid(i,1); AfxMessageBox(String\[i\]); }
The price of anything is the amount of life you exchange for it. Thanks and Regards. SANTHOSH V
Thanks.... But i have Two digit nubers also..... like CString out={"1,10,345"}; then how to do... :doh: Thanks in advance varma
-
Thanks.... But i have Two digit nubers also..... like CString out={"1,10,345"}; then how to do... :doh: Thanks in advance varma
as ever replied, use CString::Tokenize()[^]
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]