Remove a character at a certain position in a string - javascript [duplicate]

Is there an easy way to remove the character at a certain position in javascript?

e.g. if I have the string "Hello World", can I remove the character at position 3?

the result I would be looking for would the following:

"Helo World"

This question isn't a duplicate of How can I remove a character from a string using JavaScript?, because this one is about removing the character at a specific position, and that question is about removing all instances of a character.


It depends how easy you find the following, which uses simple String methods (in this case slice()).

var str = "Hello World";
str = str.slice(0, 3) + str.slice(4);
console.log(str)

You can try it this way!!

var str ="Hello World";
var position = 6;//its 1 based
var newStr = str.substring(0,position - 1) + str.substring(postion, str.length);
alert(newStr);

Here is the live example: http://jsbin.com/ogagaq


Turn the string into array, cut a character at specified index and turn back to string

let str = 'Hello World'.split('')

str.splice(3, 1)
str = str.join('')

// str = 'Helo World'.