Created
June 18, 2012 02:15
-
-
Save josher19/2946430 to your computer and use it in GitHub Desktop.
escape all letters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var esc = function (c) { var x=parseInt(c, 36); return isFinite(x) ? "%" + (x+87).toString(16) : c; } | |
var escw = function(word) { return word.replace(/[a-z]/g, esc); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment