zoukankan      html  css  js  c++  java
  • string::find()关键字符串定位

     语法: 

    1 1.size_type source_str.find( const basic_string &str, size_type index );
    2 2.size_type  source_str.find( const char *str, size_type index );
    3 3.size_type  source_str.find( const char *str, size_type index, size_type length );
    4 4.size_type  source_str.find( char ch, size_type index );

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

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

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

  • 相关阅读:
    全网数据库大全
    Docker最全教程
    枚举策略
    POJ 1012
    阿里云轻量应用服务器入门(二)
    阿里云轻量应用服务器入门(一)
    云服务器ECS
    Codeforces 768B B. Code For 1
    链剖&LCT总结
    O(1) 查询gcd
  • 原文地址:https://www.cnblogs.com/kevinGaoblog/p/2461510.html
Copyright © 2011-2022 走看看