string问题

[复制链接]
 楼主| hsbjb 发表于 2012-5-22 14:21 | 显示全部楼层 |阅读模式
比如说定义了一个string str;的字符串类,
在这个串类是任意的字符,那么如何利用find_first_of()函数找出标点符号(包括空格,单引号,双引号,...)呢?
火箭球迷 发表于 2012-5-22 14:30 | 显示全部楼层
用这段代码试试
size_t find_first_of ( const string& str, size_t pos = 0 ) const;
size_t find_first_of ( const char* s, size_t pos, size_t n ) const;
size_t find_first_of ( const char* s, size_t pos = 0 ) const;
size_t find_first_of ( char c, size_t pos = 0 ) const;
pkat 发表于 2012-5-22 15:11 | 显示全部楼层
试试LS的代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

193

主题

2354

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

193

主题

2354

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部