Documentation
ΒΆ
Overview ΒΆ
Package emoji is designed to recognize and parse every individual Unicode Emoji characters from a string.
Unicode Emoji Documents: https://www.unicode.org/Public/emoji/
Index ΒΆ
Examples ΒΆ
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func ReplaceAllEmojiFunc ΒΆ
ReplaceAllEmojiFunc searches string and find all emojis.
Example ΒΆ
package main
import (
"fmt"
emoji "github.com/Andrew-M-C/go.emoji"
)
func main() {
printf := fmt.Printf
s := "π©βπ©βπ¦π¨π³"
i := 0
final := emoji.ReplaceAllEmojiFunc(s, func(emoji string) string {
i++
printf("%02d - %s - len %d\n", i, emoji, len(emoji))
return fmt.Sprintf("%d-", i)
})
printf("final: <%s>\n", final)
}
Output: 01 - π©βπ©βπ¦ - len 18 02 - π¨π³ - len 8 final: <1-2->
Types ΒΆ
type CharIterator ΒΆ added in v1.1.0
CharIterator is used in RangeChars
func IterateChars ΒΆ added in v1.1.0
func IterateChars(s string) CharIterator
IterateChars iterates a string, and extract every characters.
Example ΒΆ
package main
import (
"fmt"
emoji "github.com/Andrew-M-C/go.emoji"
)
func main() {
s := "China:π¨π³;Japan:π―π΅"
for it := emoji.IterateChars(s); it.Next(); {
fmt.Println(it.Current(), "-", it.CurrentIsEmoji())
}
}
Output: C - false h - false i - false n - false a - false : - false π¨π³ - true ; - false J - false a - false p - false a - false n - false : - false π―π΅ - true
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
internal
|
|
|
official
Package official indicates official unicode emoji variables.
|
Package official indicates official unicode emoji variables. |
|
tool/const
module
|