C++学习记录之string修改

指定元素的修改 代码: include<iostream> #include<string> using namespace::std; int main(void) { string str; str=("abcdefg"); str[2]='s'; str.at(3)='q'; str.insert(5,"sadfk"); cout << str << endl; return 0; } 执行
相关文章
相关标签/搜索