我需要范围 实施例替换字符串:如何用范围替换字符串?
string = "this is a string";//I need to replace index 0 to 3 whith another string Ex.:"that"
result = "that is a string";
但这种需要是dinamically。不能被取代固定字...需要时可使用范围
我已经试过
result = string.replaceAt(0, 'that');
但这仅替换第一个字符,我想第一至第三
你能不能更多分心请 – user1529342
你试过了什么?你是否查看了字符串方法的[documentation](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/prototype#Methods)? – jbabey