Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

JavaScript: Escape / Unescape Using _ instead of %

Using JavaScript, how can I use _ instead of % to escape characters?

var xyz = escape('Hello_World "123%"');
document.write( xyz );
document.write( '<hr/>');
document.write( unescape(xyz) );

Open in new window

0
hankknight
Asked:
hankknight
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you would have to do it manually:

var xyz = Hello_World "123%';
xyz = xyz.replace( '%', '_' )
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now