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

  • 相关阅读:
    数据结构相关概念
    树的创建与遍历
    Java探索之旅(18)——多线程(2)
    Java探索之旅(17)——多线程(1)
    Java Servlet 笔记4
    Java Servlet 笔记3
    Java Servlet 笔记2
    Java Servlet 笔记1
    JavaBean实现用户登陆
    基于SSE4和多核编程的电子相册的实现
  • 原文地址:https://www.cnblogs.com/kevinGaoblog/p/2461510.html
Copyright © 2011-2022 走看看