Created
March 8, 2021 23:42
-
-
Save Justintime50/0e440bdb680929bd6ce15f49f687904e to your computer and use it in GitHub Desktop.
Make emoticons from letters, great for Slack messages
This file contains 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
// Make emoticons from your letters for Slack | |
let words = "Alright fine, I did the needful and joined you."; | |
words = words.replace(/[.,/#!$%^&*;:{}=\-_`'~()]/g, "") | |
function emotify() { | |
let w = words.split(""); | |
for (let i = 0; i < w.length; i++) { | |
if (w[i] !== " ") { | |
w[i] = ":cs-" + w[i] + ":" | |
} else { | |
w[i] = ":cs-s-sp:" | |
} | |
} | |
console.log(w.join("")); | |
} | |
emotify() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment