string的find操作
来源:互联网 发布:java 时间转换 毫秒 编辑:程序博客网 时间:2024/06/05 09:15
find
//从pos开始查找字符c在当前字符串的位置int find(char c, int pos = 0) const;//从pos开始查找字符串s在当前串中的位置int find(const char *s, int pos = 0) const;//从pos开始查找字符串s中前n个字符在当前串中的位置int find(const char *s, int pos, int n) const;//从pos开始查找字符串s在当前串中的位置int find(const string &s, int pos = 0) const;//以上查找成功时返回所在位置,失败返回string::npos的值
rfind
//从pos开始从后向前查找字符c在当前串中的位置int rfind(char c, int pos = npos) const;int rfind(const char *s, int pos = npos) const;int rfind(const char *s, int pos, int n = npos) const;int rfind(const string &s,int pos = npos) const;//从pos开始从后向前查找字符串s中前n个字符组成的字符串在当前串中的位置,成功返回所在位置,失败时返回string::npos的值
find_first_of
//从pos开始查找字符c第一次出现的位置int find_first_of(char c, int pos = 0) const;int find_first_of(const char *s, int pos = 0) const;int find_first_of(const char *s, int pos, int n) const;int find_first_of(const string &s,int pos = 0) const;//从pos开始查找当前串中第一个在s的前n个字符组成的数组里的字符的位置。查找失败返回string::npos
find_first_not_of
//从当前串中查找第一个不在串s中的字符出现的位置,失败返回string::nposint find_first_not_of(char c, int pos = 0) const;int find_first_not_of(const char *s, int pos = 0) const;int find_first_not_of(const char *s, int pos,int n) const;int find_first_not_of(const string &s,int pos = 0) const;
find_last_of
//find_last_of和find_last_not_of与find_first_of和find_first_not_of相似,只不过是从后向前查找int find_last_of(char c, int pos = npos) const;int find_last_of(const char *s, int pos = npos) const;int find_last_of(const char *s, int pos, int n = npos) const;int find_last_of(const string &s,int pos = npos) const;int find_last_not_of(char c, int pos = npos) const;int find_last_not_of(const char *s, int pos = npos) const;int find_last_not_of(const char *s, int pos, int n) const;int find_last_not_of(const string &s,int pos = npos) const;
阅读全文
0 0
- string的find操作
- string的find函数
- string 里的 find
- HDU 2054 A == B 【String 的骚操作 , string find 的应用】
- string::find()的用法总结
- C++ string find的误用
- string find的用法详解
- string find
- string find
- string find
- string.find()
- string的find和find_first_of的区别
- string的find和find_first_of的区别
- MongoDB的find操作详解
- string::find的第三个参数
- 关于string::find的返回值
- string类的查找函数 find()
- find 函数和string :: npos 的用法
- 爱加密,梆梆,360加固初比较
- 一个单词统计的实例,怎样通过MapReduce完成排序?
- Docs » Logs » Diagnosing problems using Logs
- MFC 控件添加ToolTip
- 开源许可协议GPL、APL、BSD、LGPL、MIT
- string的find操作
- flex-grow、flex-shrink、flex-basis详解
- hibernate概述及基础知识
- cnanot find xxxx.so 异常的解决方案
- 如何针对产品销售设计一套有效的奖励和惩罚销售措施?
- 第四十六篇: JAVA加密解密之消息摘要算法(MessageDigest)
- 分布式事务与一致性算法Paxos & raft & zab
- ANDROID内存优化
- 《并发编程》--13.CountDownLatch和CyclicBarrier