emoji
emoji copied to clipboard
How could I convert emoji string to emoji icons and vice versa?
How could I convert emoji string to emoji icons and vice versa? For e.g.
msg := "😀 😃 😄 😁 😆 😅 😂 🤣 \U0001F972 😊 😇 :plus:"
I wanted to convert \U0001F972
and :plus:
to emojis
Also I could convert emojis to \U0001F972
or :plus:
format
I could convert :plus: to Emoji and Unicode strings like \U0001F972 OR I could convert \U0001F972 to :some string: and Emoji OR I could convert Emoji to :plus: or \U0001F972
Here is a way to convert a string of emoji to sample.
package main
import (
"github.com/kyokomi/emoji/v2"
)
func main() {
msg := "😀 😃 😄 😁 😆 😅 😂 🤣 \U0001F972 😊 😇 :plus:"
emoji.Println(msg)
}
Currently, we have a map for reverse lookup, but we do not provide an interface for reverse conversion. https://github.com/kyokomi/emoji/blob/master/emoji.go#L25-L28