获取CString的子串

要用了才想起来不知道^_^
找了好一会,原来这么简单tiaopi
[codes=c]
CString str(“http://www.ddrr.org”);
CString str1, str2, str3;
str1 = str.Left(3);    // htt
str2 = str.Mid(11, 4);  // ddrr。注意,第二个参数是代表子串的长度
str3 = str.Right(3);  // org
[/codes]

Trim:删除字符串左右两边的空格及控制字符

You may also like...

发表评论

邮箱地址不会被公开。 必填项已用*标注