摘要: 1.find() 返回值为目标元素的下标,若不存在目标元素则返回-1 #include<iostream> using namespace std; int main() { string str1 = "A BC", str2 = "abc"; char c = '5'; int i; i= st 阅读全文
posted @ 2020-12-14 23:57 Asunataisiki 阅读(118) 评论(0) 推荐(0)
摘要: insert函数包含在#include<iostream>中,其作用是在指定的地方添加字符/字符串。 基本格式:字符串名称 = 原字符串.insert(start,(count),' 字符 ' / " 字符串 ") start表示在哪个位置前开始添加,而count表示添加几个(仅在添加字符时才能使用 阅读全文
posted @ 2020-12-13 23:45 Asunataisiki 阅读(810) 评论(0) 推荐(0)