首页 > 编程语言 > 详细

C++ string的若干问题

时间:2015-08-08 16:11:44      阅读:300      评论:0      收藏:0      [点我收藏+]

1.string的find函数

 查找(find)

  语法:

 size_type find( const basic_string &str, size_type index );

 size_type find( const char *str, size_type index );

 size_type find( const char *str, size_type index, size_type length );

 size_type find( char ch, size_type index );

  find()函数:

 返回str在字符串中第一次出现的位置(从index开始查找)。如果没找到则返回string::npos,

 返回str在字符串中第一次出现的位置(从index开始查找,长度为length)。如果没找到就返回string::npos,

 返回字符ch在字符串中第一次出现的位置(从index开始查找)。如果没找到就返回string::npos 

C++ string的若干问题

原文:http://www.cnblogs.com/lkwangpy/p/4713271.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!