-
Couldn't load subscription status.
- Fork 0
ProtoString escapeRegExp Method
Seth Clydesdale edited this page Jun 8, 2015
·
1 revision
<< Back to Miscellaneous Methods
Escaping regexp characters.
'Would you like ${food}?'.escapeRegExp(); // returns 'Would you like \$\{food\}\?'The escapeRegExp method escapes special characters used in regular expressions. This can be used to clean a string before inserting it into a regular expression object.
String.escapeRegExp();Home • History • ProtoString • Created by Seth Clydesdale