vah*_*cho 16
你可以试试这个:
QString str("this is a string"); // The initial string.
QString subStr("is"); // String to replace.
QString newStr("at"); // Replacement string.
str.replace(str.indexOf(subStr), subStr.size(), newStr);
Run Code Online (Sandbox Code Playgroud)
结果字符串将是:
那是一个字符串