Give other people's program, there is a case where you need to split the Chinese characters, letters, and you have found the same paragraph.
"************* intercept string ************** FUNCTION Interceptstring (txt, length) txt = trim (txt) x = len (txt) y = 0 IF x> = 1 Then for II = 1 TO X IF ASC (MID (TXT, II, 1)) <0 or ASC (MID (TXT, II, 1))> 255 THEN "If it is Chinese character y = Y 2 else y = y 1 End if ifness y> = length THEN TXT = LEFT (TRIM (TXT), II) "String Long EXIT for end if next interceptstring = txt else interceptstring =" "" END if End function
The result is that there are some cases of splitting, and it has been garbled, depressed for a long time, and finally discovered that the code reposted on the Internet is wrong. In fact, this error is very simple, that is, because I didn't carefully check it. ^ _ ^, This time I am correct, I hope that the people who will see later will not be depressed.
void CAaaView :: OnButton1 () {// TODO: Add your control notification handler code here CString ChargeItemName; CString aa = "9494858 gains and losses under test 585858585888d888888888888888"; int len = 0; ChargeItemName = InterceptString (len, aa); AfxMessageBox (ChargeItemName );
len = ChargeItemName.GetLength (); ChargeItemName = aa.Mid (len); AfxMessageBox (ChargeItemName);} CString CAaaView :: InterceptString (int qlen, CString strSource) {int len, i, y; CString sTemp, sreturn, ceshi;
STRSOURCE.trimleft (); strsource.trimright (); len = stravece.getLength (); y = 0; step = strsource.right (len-qlen); for (i = 0; i
Return Sreturn;}