string类find_first_not_of ()方法

 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://xfqxj.blog.51cto.com/2342497/512015
#include <string> #include <iostream>
using namespace std; int main()
{
string strFirst ( "abced" ),strSecond("abc abc abd def");
cout<<strFirst.find("a")<<endl;//输出结果为0,说明a当前的索引位置为0 //函数原型:size_type find_first_not_of( Char ch, size_type index = 0 ) const;
//返回在字符串中首次不匹配 d 的首字符索引,从2开始。
cout<<strFirst.find_first_not_of ( "d" ,)<<endl;//输出结果为 2 cout<<strSecond.length()<<endl;//输出结果为15
cout<<strSecond.find_first_not_of("abc",)<<endl;//输出结果为7
system("pause");
}

最新文章

  1. 【linux草鞋应用编程系列】_1_ 开篇_系统调用IO接口与标准IO接口
  2. select for update行锁
  3. LINQ的Union方法
  4. 【BZOJ-4562】食物链 记忆化搜索(拓扑序 + DP)
  5. js判空
  6. 强制JSP页面刷新,防止被服务器缓存(可用于静态include强制刷新)
  7. BZOJ 1003 物流运输
  8. Could not load file or assembly &#39;MagickNet.dll&#39;
  9. powerdesigner连接数据库 导出数据 生成PDM文件 傻瓜试教程
  10. vb delphi7、2010 csharp vb.net空白测试程序
  11. Spring Autowire自动装配
  12. JQuery EasyUi 扩展combox验证
  13. queue C++
  14. Codeforces543BDestory Roads心得
  15. [UE4]Drop,扔物品
  16. TP5中的小知识
  17. canvas 动画 时钟clock
  18. Spring工作原理与单例
  19. EF三种加载方法
  20. phalcon的CLI应用

热门文章

  1. MFC学习笔记1---准备工作
  2. 【学习】022 ActiveMQ
  3. [易学易懂系列|golang语言|零基础|快速入门|(三)]
  4. python文件读写详解
  5. java Thread源码分析(二)
  6. flask-migrate的使用
  7. 【LuoguP3747】[六省联考2017] 相逢是问候
  8. 使用idea对XML的增删改查
  9. Linux学习-LVS跨网段DR模型和FWM多服务绑定
  10. CSS3实现三角形和对话框