We would like to know how to remove character from a string.
<!DOCTYPE html>
<html>
<head>
<script>
var mystring = "jav/test string";
<!--from w w w. j a v a 2s . c om-->
String.prototype.replaceAt = function (index, char) {
console.log(char.length);
return this.substr(0, index) + char + this.substr(index + 1);
}
document.writeln(mystring.replaceAt(4, ''))
</script>
</head>
<body>
</body>
</html>
The code above is rendered as follows: