Skip Navigation

[Rust] Why code in text like a peasant when you can code using emojis

tomdebruijn.com Calculating String length and width – Fun with Unicode

Finding the string length sounds easier than it is, if we want to be really accurate. Let's explore how does Unicode and emoji make this step more complex.

Calculating String length and width – Fun with Unicode

Why use pi when you can use 🥧

fn main() {
    let pi_emoji = "🥧";
    let pi_value = 3.1415926535897932384626433832;

    println!("Let {} {:.28}", pi_emoji, pi_value);
}
0
0 comments