Created
June 17, 2015 09:20
-
-
Save execmd/906c1bb34a7e452e3cda to your computer and use it in GitHub Desktop.
Generate string from char code ranges
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 string = ''; | |
| var chars = [[48, 57], [65, 90], [97, 122]]; | |
| chars.forEach(function (charRange) { | |
| for (var i = charRange[0]; i<=charRange[1]; i++) { | |
| string += String.fromCharCode(i); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment