2017  Kodetalk | Feedback | Privacy Policy | Terms | About

Delete first character of a string in Javascript

I written some piece of script in Javascript where I am getting the tagnames through iteration.

var selectedTag = "";




            selectedTags = selectedTags+","+$(this).val();   




Now I want to remove the comma(first character of the string). Please suggest.


var s = "0000var";

while(s.charAt(0) === '0')   

s = s.substr(1);

This will remove 0's at the start of the string

Answer is