Kanishka Kanishka - 1 year ago 68
jQuery Question

Java script Trim with charactor

I have a string like this

var str=",test,test1,test2,teset4"


How can i Remove the ',' infront of the string.
So the out put will be something like this

'test,test1,test2,teset4'

Answer Source

you can try this:

str.substr(1)

var str=",test,test1,test2,teset4"
alert(str.substr(1))