Kanishka Kanishka - 3 months ago 8
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

you can try this:

str.substr(1)

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

Comments