Created
March 30, 2017 10:07
-
-
Save veganben/167080a8d9bb237c34063696a399ed90 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
| String.prototype.latinify = function() { | |
| var map = { | |
| ä: "ae", | |
| ö: "oe", | |
| ü: "ue", | |
| Ä: "Ae", | |
| Ö: "Oe", | |
| Ü: "Ue" | |
| }; | |
| var replacedString = ""; | |
| for(var i = 0; i < this.length; i++) { | |
| replacedString += map[this[i]] || this[i]; | |
| } | |
| return replacedString; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment