I have a string, let\'s say Hello world and I need to replace the char at index 3. How can I replace a char by specifying a index?
Hello world
var str = \"h
In Javascript strings are immutable so you have to do something like
var x = "Hello world" x = x.substring(0, i) + 'h' + x.substring(i+1);
To replace the character in x at i with 'h'