✨ Lookup and iterate over emoji names, shortcodes, and groups.
```rust let hand = emojis::get("🤌")?; // or let hand = emojis::getbyshortcode("pinched_fingers")?;
asserteq!(hand.asstr(), "\u{1f90c}"); asserteq!(hand.name(), "pinched fingers"); asserteq!(hand.unicodeversion(), emojis::UnicodeVersion::new(13, 0)); asserteq!(hand.group(), emojis::Group::PeopleAndBody); asserteq!(hand.shortcode()?, "pinchedfingers"); asserteq!(hand.skintone()?, emojis::SkinTone::Default);
// iterate over all the emojis. let smiley = emojis::iter().next()?; assert_eq!(smiley, "😀");
// iterate and filter out newer emoji versions. let iter = emojis::iter().filter(|e| { e.unicode_version() < emojis::UnicodeVersion::new(13, 0) });
// iterate over all the emojis in a group. let grapes = emojis::Group::FoodAndDrink.emojis().next()?; assert_eq!(grapes, "🍇");
// iterate over the skin tones for an emoji. let raisedhands = emojis::get("🙌🏼")?; let skintones: Vec<_> = raisedhands.skintones()?.map(|e| e.asstr()).collect(); asserteq!(skin_tones, ["🙌", "🙌🏻", "🙌🏼", "🙌🏽", "🙌🏾", "🙌🏿"]); ```
See examples/replace.rs for an example that replaces gemoji names in text.
sh
$ echo "launch :rocket:" | cargo run --example replace
launch 🚀
Licensed under either of
at your option.