1 unstable release
new 0.1.0 | Nov 2, 2024 |
---|
#671 in Text processing
5KB
Emoji Converter
A Rust library to convert words in a sentence into emojis! This library provides a fun and simple way to add emoji representations to text.
Installation
Add this to your Cargo.toml
:
[dependencies]
emoji_converter = "0.1.0"
Usage
use emoji_converter::convert_to_emoji;
fn main() {
let sentence = "Hello world! Love Pizza!";
let emoji_sentence = convert_to_emoji(sentence);
println!("{}", emoji_sentence);
}
Summary
With documentation in place, our crate is ready for users to understand its purpose, how to use it, and what to expect from its functions. Next, we’ll move on to preparing Cargo.toml
for publishing on crates.io.
lib.rs
:
Emoji Converter
A simple library to convert words in a sentence to emojis based on predefined mappings. This library is designed for fun applications and quick text transformations.
Example
use emoji_converter::convert_to_emojis;
let result = convert_to_emojis("I love coffee and pizza");
assert_eq!(result, "I ❤️ ☕️ and 🍕");
``