• C++ 关于字符串总结(持续更新)


    1.find_first_of

    size_type find_first_of( const basic_string &str, size_type index = 0 ); 
    size_type find_first_of( const char *str, size_type index = 0 ); 
    size_type find_first_of( const char *str, size_type index, size_type num ); 
    size_type find_first_of( char ch, size_type index = 0 ); 

    查找在字符串中第一个与str中的某个字符匹配的字符,返回它的位置。搜索从index开始,如果没找到就返回string::npos 注:npos表示size_t的最大值 
    查找在字符串中第一个与str中的某个字符匹配的字符,返回它的位置。搜索从index开始,最多搜索num个字符。如果没找到就返回string::npos, 
    查找在字符串中第一个与ch匹配的字符,返回它的位置。搜索从index开始。

    2.std::string line  line.erase(pos,num); 删除字符串中的从pos位置开始的num个字符

  • 相关阅读:
    Sqlite数据库sqlite3命令
    cerr
    include 尖括号和双引号
    C程序存储空间布局——各数据段的内存位置
    贪心算法
    CodeBlocks
    O(n)是什么
    微软公司面试题
    CSS3---结构性伪类选择器—not
    CSS3---结构性伪类选择器-root
  • 原文地址:https://www.cnblogs.com/zhaoheng/p/4520935.html
Copyright © 2020-2023  润新知