Below Regex(Regular Expression) should help:
Enjoy :)
var edited = test.replace(/^,|,$/g,'');
^, matches the comma at the start of the string and ,$ matches the comma at the end ..Enjoy :)
04:33
Anonymous

0 comments:
Post a Comment