当前位置:网站首页>STL string find substring
STL string find substring
2022-07-19 13:42:00 【joker_ 0030】
#include <iostream>
using namespace std;
//#pragma warning(disable:4996)// Remove warning 4996
void StrFunction()
{
string str2("aabasasaaqde");
string str3("aaq");
// find function .
cout << str2.find(str3, 7)<<endl;// Find and str3 The same string ,str2 Subscript is 7.
cout << str2.find(str3, 8)<<endl;//find Returns an unsigned integer .
cout << (int)str2.find(str3, 8)<<endl;//find Returns an unsigned integer .
cout << str2.find("aaq", 2) << endl;
cout << str2.find('a', 2) << endl;
cout << str2.substr(2,4) << endl;// Returns the string from the subscript 2 Start ( Add subscript 2) There are four characters in total .
str2.swap(str3);
cout << str2<<endl;//str2 And str3 swapping .
cout << str2+str3<<endl;//str2 And str3 Add up .
cout << str2+"sjdhj" << endl;//str2 And str3 Add up .
}
int main()
{
StrFunction();
system("pause");
return 0;
}
边栏推荐
- Transphorm的表面贴装封装产品系列增加行业标准TO-263 (D2PAK)封装产品,扩大SuperGaN平台的优势
- [postgraduate entrance examination vocabulary training camp] day 7 - second, attract, current, collect, simple, communicate, vocation
- [understanding of opportunity-46]: Guiguzi - Chapter 10 - schemer, meaning of wisdom
- 面试官:可以接受转Go吗?
- torch. utils. data. Dataloader description
- eth入门之运行节点
- Onvif protocol related: 3.1.2 get the token list in digest mode
- 【码蹄集新手村 600 题】输出时的左对齐,右对齐
- MySQL advanced (VI) introduction to four common uses of fuzzy query
- STM32F1与STM32CubeIDE编程实例-MPU-6050 六轴(陀螺仪 + 加速度计)驱动
猜你喜欢

忘掉Postman,Apifox更好用

「津津樂道播客」#392 原湯話原食:仲夏夜,馬砂、肉串兒、趿拉板兒

Design and Simulation of anti reverse connection circuit based on MOS transistor

Interviewer: is it acceptable to transfer to go?
![[pumpkin Book ml] (task2) mathematical derivation of linear model (least squares estimation, generalized Rayleigh quotient, maximum likelihood estimation, etc.)](/img/ab/aaf4c01144364e7999582f326f16af.png)
[pumpkin Book ml] (task2) mathematical derivation of linear model (least squares estimation, generalized Rayleigh quotient, maximum likelihood estimation, etc.)

codeforce:A. Difference Operations【数学思维】
![[code hoof set novice village question 600] format specifier of float and double](/img/19/433f794617f3c3c72732f1a4efe252.png)
[code hoof set novice village question 600] format specifier of float and double

基于MOS管的防反接电路设计仿真

Android开发大厂面试,做好这3个准备,规划好自己

面试官:可以接受转Go吗?
随机推荐
模块7(王者荣耀商城异地多活架构设计)
How to upgrade Flink job gracefully?
统计直播间的榜一信息,从这里起步
ArrayList underlying analysis
Android开发大厂面试,做好这3个准备,规划好自己
eth入门之运行节点
Onvif protocol related: 3.1.2 get the token list in digest mode
关于XML文件(七)- XML DTD
【码蹄集新手村 600 题】针对于字符串的格式化控制,即字符串的宽度与精度
[record of question brushing] 13 Roman numeral to integer
国内外十大erp软件系统排名!
动手学深度学习(第二版)注释后代码【持续更新】
云审计服务CTS是一项付费服务,付费项目包括开通追踪器、事件跟踪以及7天内事件的存储和检索等相关费用
[postgraduate entrance examination vocabulary training camp] day 6 - eventually, state, create, productivity, stimulate
【考研词汇训练营】Day 6 —— eventually,state,create,productivity,stimulate
【7.15】代码源 -【整齐的数组2】【三进制循环】【树上逆序对】【蜗蜗的数列】
S32K148_ Can drive (bare metal development)
S32K148_CAN驱动(裸机开发)
【7.8】Educational Codeforces Round 131 (Rated for Div. 2)
「津津乐道播客」#392 原汤话原食:仲夏夜,马砂、肉串儿、趿拉板儿