Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  32] [ 2]  / answers: 1 / hits: 110117  / 15 Years ago, thu, october 22, 2009, 12:00:00

I'm running into an issue that I think is being caused by needing to double-up on some single quotes inside a string. However, JS's string.replace uses RegEx, and I've never built a RegEx by hand.



Can someone help me build a RegEx to find a single quote and replace it with two single quotes?


More From » regex

 Answers
16

Try this:



yourstring = yourstring.replace(/'/g, '')

[#98462] Monday, October 19, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarrettw

Total Points: 300
Total Questions: 98
Total Answers: 103

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;