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.
You can use String.prototype.trimStart(). Like this:
myString=myString.trimStart();
An if you want to trim the tail, you can use:
myString=myString.trimEnd();
Notice, this 2 functions are not supported on IE. For IE you need to use polyfills for them.