[Javascript] How to delete first character of a string?


I want to delete the first charater from a given string, How can I do that in Javascript?

1 Answer

3 years ago by

You can use any of the below methods to delete first character from the given string.

let str = "Hello, World!";

console.log(str.substring(1));
console.log(str.slice(1));
console.log(str.substr(1));

Run here https://onecompiler.com/javascript/3xns2kcf2

3 years ago by Meera