#1174. C++-字符串-定义字符串“www.paifuture.com.cn”,在尾部增加“/C++”,通过string...
C++-字符串-定义字符串“www.paifuture.com.cn”,在尾部增加“/C++”,通过string...
Background
Description
定义字符串“www.paifuture.com.cn”并打印,在尾部增加“/C++”,通过string的substr()函数获取“paifuture”并打印出来
1、定义一个string类对象“www.paifuture.com.cn”并2打印字符串长度
2、拼接“/C++”并打印
3、找到“/C++”的位置并打印
4、删除“/C++”并打印字符串
5、获取“paifuture”并打印
使用string的函数:
string.length(https://blog.csdn.net/white_night_SZTU/article/details/127447773)
string.append(https://blog.csdn.net/qq_20853741/article/details/109498177)
string.find(https://blog.csdn.net/gentleman_97/article/details/122339565)
string.replace(https://blog.csdn.net/yinhe888675/article/details/50920836)
string.find_first_of(https://blog.csdn.net/qq_40968179/article/details/104375849)
string.find_last_of(https://blog.csdn.net/qq_40968179/article/details/104375849)
string.substr(https://blog.csdn.net/weixin_42258743/article/details/107782394)
Format
Input
Output
Samples
20
www.paifuture.com.cn/C++
20
www.paifuture.com.cn
paifuture
Limitation
1s, 1024KiB for each test case.