我知道这已被问了很多次,但我是一个完整的初学者,并不明白任何答案,并且他们似乎并没有工作时我试图运行所述解决方案。我想知道如何用一个变量或潜在的另一个字符串替换一部分字符串。用一个变量或另一个字符串替换字符串的一部分
所以,如果我的代码如下所示:
var text = "Eam dicit fuisset volumus an, usu ea tibique consulatu scribentur.";
var otherString = "Random text";
...我如何与otherString取代text.substring [9,20],例如。
请尽可能地解释。
'text.replace('string to replace','string to insert')'not enough enough? – Chad