I want to remove the white space which is there in the start of the string It should remove only the space at the start of the string, other spaces should be there.
.trimLeft() can be used for this.
.trimLeft()
const str = " string "; console.log(str.trimLeft()); // => "string "