当前位置:网站首页>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;
}
边栏推荐
- STL string复制比较
- onvif协议相关:3.1.2 Digest方式获取token列表
- [code hoof set novice village 600 question] calculate the number of digits of an integer
- [code hoof set novice village question 600] align left and right when outputting
- SSH keyless login
- How to add a thread in MFC
- 【7.13】代码源 -【饿饿 饭饭】【路径计数2】【函数求和】
- 基于PMOS的过压保护(OVP)电路仿真
- Onvif protocol related: 4.1.4 WS username token method to obtain the stream address
- 健康防猝指南3:健康保健
猜你喜欢

onvif协议相关:3.1.1 Digest方式获取Authorization

健康防猝指南3:健康保健

Onvif protocol related: 3.1.2 get the token list in digest mode

Onvif protocol related: 2.1.1 get token in none mode

QT use qlisview to realize QQ login history list
![Codeforce:a. difference operations [mathematical thinking]](/img/be/28bcb5dd8b9a36f2955f1912f289a3.png)
Codeforce:a. difference operations [mathematical thinking]

2.三数之和

Flutter 使用 AnimatedSwitcher 做场景切换

(PC+WAP)织梦模板服装礼服类网站

【Acwing】第60场周赛 题解
随机推荐
[code hoof set novice village question 600] operator / type conversion in different operation sequences
Simulation of overvoltage protection (OVP) circuit based on PMOS
【js逆向爬虫】-有道翻译js逆向实战
卤味店,如何在低线城市挣钱
onvif协议相关:2.1.3 none方式获取流地址
基于MOS管的防反接电路设计仿真
Principle of voice communication network
How to earn money in low-level cities
【7.15】代码源 -【整齐的数组2】【三进制循环】【树上逆序对】【蜗蜗的数列】
力扣第 302 场周赛
鸿蒙设备开发快速入门之Helloword与LED——华为云14天鸿蒙设备开发实战学习笔记 第二篇
Codeforces Round #808 (Div. 2)ABCD
Qt之使用QLisView实现QQ登录历史列表
忘掉Postman,Apifox更好用
【码蹄集新手村 600 题】如何使整数逆序
Elastic load balancing automatically distributes the access traffic to multiple cloud servers, expands the external service capacity of the application system, and improves the security of the applica
[postgraduate entrance examination vocabulary training camp] day 6 - eventually, state, create, productivity, stimulate
OpenSSL operation
ssh无密钥登录
torch. utils. data. Dataloader description