string使用

5 阅读1分钟

1.substr(4,5),从4开始截取5个长度的字符串 2.replace(4,5,“abc”),从4开始截取5个长度,替换为abc 3find(“abc”) 4.用s.c_str(),可以用printf输出string字符串