Documentation
¶
Index ¶
Constants ¶
const Version = "17.0.0"
Supported Unicode version
Variables ¶
This section is empty.
Functions ¶
func ContainsEmoji ¶
Matches all* emojis
- default emoji presentation character (ED-6)
- emoji presentation sequence (ED-9a)
- emoji keycap sequence (ED-14c)
- emoji flag sequence (ED-14)
This should include all basic emoji defined by ED-20.
See emoji-sequences.txt for a list of matching emojis.
Examples:
"A" -> false // U+0041 "⏳" -> true // U+231B "🌍" -> true // U+1F30D "☀" -> false // U+2600 "♻" -> false // U+267B "☀️": true // U+2600 U+FE0F "♻️": true // U+267B U+FE0F
func ContainsFlag ¶
Matches a string that contains atleast one flag emoji officially known as emoji flag sequence (ED-14). Does not check if the flag is valid.
func IsFlagSequence ¶
Matches flag emojis officially known as emoji flag sequence (ED-14). Does not check if the flag is valid.
func IsSingleCharacterEmoji ¶
Matches codepoints that are default emoji presentation character (ED-6) that can be repressented as a single rune / codepoint.
Codepoints that appear as text by default (ED-7) but can appear as emoji using emoji presentation sequence (ED-9a) are not matched because the pressence of U+FE0F VARIATION SELECTOR-16 (VS16) can not be verified from a single rune.
See section Basic_Emoji of emoji-sequences.txt for a list of matching emojis.
Examples:
'A' -> false // U+0041 '⏳' -> true // U+231B '🌍' -> true // U+1F30D '☀' -> false // U+2600 '♻' -> false // U+267B
This function can also be defined as Emoji_Presentation=Yes and Emoji_Component=No
func ToEmojiPresentation ¶ added in v1.1.0
Make all emojis in a given string appear in their emoji variants. Numbers remain unchanged.
This is done using the U+FE0F VARIATION SELECTOR-16 (VS16) to form a ED-9a text presentation sequence. This can only be done to characters listed in emoji-variation-sequences.txt.
Examples
"1" -> "1" "☀" -> "☀️"
func ToTextPresentation ¶ added in v1.1.0
Make all emojis in a given string appear in their text variants. Numbers remain unchanged.
This is done using the U+FE0E VARIATION SELECTOR-15 (VS15) to form a ED-8a text presentation sequence. This can only be done to characters listed in emoji-variation-sequences.txt.
Examples
"1" -> "1" "⏳" -> "⏳︎"
Types ¶
This section is empty.