javascript - Remove first character from a string if it is a comma -


I need to set the function in javascript to remove the first letter of the string, but only if it is a comma , . I've found the substr function but anything will go away from it, even if it does.

My current code is

  text.value = newvalue.substr (1);  

  text.value = newvalue.replace (/ ^, /, ' ');  

Edit: Test and true. It's just the way to do one , though.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -