Skip to content

Instantly share code, notes, and snippets.

@Justintime50
Created March 8, 2021 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Justintime50/0e440bdb680929bd6ce15f49f687904e to your computer and use it in GitHub Desktop.
Save Justintime50/0e440bdb680929bd6ce15f49f687904e to your computer and use it in GitHub Desktop.
Make emoticons from letters, great for Slack messages
// 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