Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toLanguage(text) {
- return text.replace(/[^aeiou]/g, function(pattern) { return pattern + "op" })
- }
- function toEnglish(text) {
- return text.replace(/[^aeiou]op/g, function(pattern) { return pattern[0] })
- }
- const inLanguage = "dopavopidop"
- const inEnglish = "catherine"
- console.log(toEnglish(inLanguage)) //david
- console.log(toLanguage(inEnglish)) //copatophoperopinope
Advertisement
Add Comment
Please, Sign In to add comment