how to remove particular character from index string in javascript code example

Example 1: javascript remove specific character from string

var newString = oldString.replaceAll("character/string goes here", "");

// Example
var oldString = "Hello World!";
var newString = oldString.replaceAll("o", "");
console.log(newString);
// Prints 'Hell Wrld!' to console.

Example 2: remove character at index from string javascript

// removing char at index 3
var str = "Hello World";
str = str.slice(0, 3) + str.slice(4);

console.log(str)  // Helo World

Tags:

Java Example