string& replace(size_t pos, size_t n, const char *s):将当前字符串从pos索引开始的n个字符,替换成字符串s
string& replace(size_t pos, size_t n1, size_t n2, char c):将当前字符串从pos索引开始的n1个字符,替换成n2个字符c
string& replace(iterator i1, iterator i2, const char* s):将当前字符串[i1, i2)区间中的字符串替换为字符串s
string s1("hello,world!");
s1.replace(6, 5, "girl"); // 结果:hello,girl.
s1.replace(s1.size() - 1, 1, 1, '.'); // 结果:hello,world.
s1.replace(s1.begin(), s1.begin() + 5, "boy"); // 结果:boy,girl.