- Home
- JavaScript
- WEIRD ALL CAPS LETTERS
WEIRD ALL CAPS LETTERS
I saw a video on youtube with a title consisting of some strange typeface that really stood out.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Here’s a javascript function that will convert your text to these characters:
function weirdLetters(str) {
var resp = '';
for(var i = 0; i < str.length; i++) {
var lettCode = str[i].toUpperCase().charCodeAt(0);
if(lettCode < 65 || lettCode > 90) {
resp += str[i];
} else {
resp += String.fromCharCode(65313 + (lettCode-65));
}
}
return resp;
}
weirdLetters("My Phrase To Make All Caps");