Jump to content

.replace()


astralaaron

Recommended Posts

I've been having trouble with this. Will someone point out my error? I searched around and nothing I found worked.varA = "it's a test, it's a test";*one example I've triedvarB = varA.replace(/\'/g, "\'");*another example...varB = varA.replace(/'/g, "\'");(trying to get "it\'s a test, it\'s a test" to output)varB = varA.replace(/(['])/g, "\\\'"); ended up working like I need... thanks anyway!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...