Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
var re = /^-/;
var sourcestring = "-source string to match with pattern";
var result = sourcestring.replace(re, "");
alert("result = " + result);
Open in new window
sourcestring = (sourcestring.substr(0,1)=='-' ) ? sourcestring.substring(1):sourcestring;
We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!