I have a quick question
I have string var str="0-12345";
How can I actually remove the dash from the string if there is one in Javascript .. How can I check if a string has a dash , and if it has , remove the dash from it ?
I have a quick question
I have string var str="0-12345";
How can I actually remove the dash from the string if there is one in Javascript .. How can I check if a string has a dash , and if it has , remove the dash from it ?
you have forgot to do the homework before you asked here , any way
var str="0-12345";
var is_dashed=(str.indexOf("-") !== -1);
str= str.replace('-',''); //many more ideas , it seems simple to remove all '-'