聊聊手机网游(一)
2008-01-03 09:31
302 查看
http://www.vczx.com/article/show.php?id=845
(一) 概述
string和CString均是字符串模板类,string为标准模板类(STL)定义的字符串类,已经纳入C++标准之中;
CString(typedef CStringT
注:find_if中是把范围内的值挨个代入匹配函数直至返回true
b) 比较
注:返回值如果<0则前面的值小于后面的值,反之亦然
c) 替换
d) 插入
(一) 概述
string和CString均是字符串模板类,string为标准模板类(STL)定义的字符串类,已经纳入C++标准之中;
CString(typedef CStringT
作用 | char* | string | CString |
查找指定值 | strchr strstr strrstr strspn | find | Find |
第一个匹配的值 | fild_first_of | FindOneOf | |
从后面开始查找 | ReserveFind | ||
指定匹配方式 | find_if |
b) 比较
作用 | char* | string | CString |
查找指定值(区分大小写) | strcmp strncmp strcoll _strncoll | operator< operator> operator<= operator>= operator== operator!= | Collate Compare |
查找指定值(不区分大小写) | _stricmp _strnicmp _stricoll _strnicoll | CollateNoCase CompareNoCas |
c) 替换
作用 | char* | string | CString |
查找指定值 | _strset _strnset | replace replace_copy replace_copy_if replace_if | Replace |
作用 | char* | string | CString |
查找指定值 | insert | Insert |