Created
August 23, 2021 16:43
-
-
Save inodaf/31e4e887df4844c79f2f37196c296089 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
function textToSlackEmoji(text: string): string { | |
return text.split('').reduce((phrase, char) => { | |
if (char) return phrase + `:alphabet-white-${char}:` | |
else return phrase + ' ' | |
}, '').replaceAll(':alphabet-white- :', ' ') | |
} | |
textToSlackEmoji('ladies and gentleman the weekend') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment