Skip to content

Instantly share code, notes, and snippets.

@error454
Created November 11, 2011 19:59
Show Gist options
  • Save error454/1359054 to your computer and use it in GitHub Desktop.
Save error454/1359054 to your computer and use it in GitHub Desktop.
Increment ASCII value of each character in a string
var incrementString = function(string, count){
var newString = [];
for(var i = 0; i < string.length; i++){
newString[i] = String.fromCharCode(string[i].charCodeAt() + count);
}
newString = newString.join('');
console.log(newString);
return newString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment