2.六、replace()函數
函數原型 String & replace(size_t pos, size_t len, const string& dest)
功能 用dest字符串替換str 字符串中從pos位置的len長度個字符
參數 size_t pos; 替換str字符的開始位置
size_t len; 替換掉str字符串的中的長度
const string & dest; 替換str的字符串
返回值: 返回一個替換後的字符串
備註
示例:str = 「hello」 dest= 「abcdef」;
str.replace(1,2,dest); //返回str = 「habcdefllo」將從第2個字符e 後面的2個字符(el)替換成abcdefide