首页 > 编程语言 >C++之字符串string

C++之字符串string

时间:2023-02-09 14:35:13浏览次数:68  
标签:string idx int C++ str 字符串 find

  1. 反转
  2. 字符串相加
  3. 转为int型:利用stoi将字符串转为整型(https://www.geeksforgeeks.org/stdstoi-function-in-cpp/)
  4. C++ 字符串split
    int idx = str.find(' ') 如有多个字符该如何,返回第一次出现的位置吗
    str.substr(idx, length) 起始坐标+子串长度

字符子串
用到的函数

#include <string>
idx = str.find_last_of
str.substr(strIdx, length)

旧电脑上应该保存一些code snippet

标签:string,idx,int,C++,str,字符串,find
From: https://www.cnblogs.com/Todd-Qi/p/15016029.html

相关文章