Created
April 2, 2015 14:26
-
-
Save edele/33372301260c7f42b7df to your computer and use it in GitHub Desktop.
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 text = "Роскомнадзор запретил букву"; | |
| var alphabet="абвгдеёжзийклмнопрстуфхцчшщьыъэюя"; | |
| for(i in alphabet){ | |
| var letter = alphabet[i]; | |
| var re = new RegExp(letter,'ig'); | |
| if (text.search(re) !== -1) | |
| console.log( (text.replace(re,"")+" "+letter.toUpperCase()).trim() ); | |
| text = text.replace(re,"").trim(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment