fn demo(message: &str, s: &str) {
    println!("\n{}\n", message);
    println!("String: {}", s);
    println!("String length: {}", s.len());
    println!("Characters debug: {:?}", s.chars());
    println!("Characters count: {}", s.chars().count());
    println!("Characters reverse: {}", s.chars().rev().collect::<String>());
    println!("Graphemes vector: {:?}", s.graphemes(true).collect::<Vec<&str>>());
    println!("Graphemes count: {}", s.graphemes(true).count());
    println!("Graphemes reverse: {}", s.graphemes(true).rev().collect::<String>());
    println!("Lowercase: {}", s.to_lowercase());
    println!("Uppercase: {}", s.to_uppercase());
}
/// Print various information about a given string.
///
/// The purpose is to show the difference between a string's bytes,
/// characters, graphemes, and related Unicode representation issues.
///
Print various information about a given string.
The purpose is to show the difference between a string's bytes,
characters, graphemes, and related Unicode representation issues.
Print various information about a given string . The purpose is to show the difference between a string ' s bytes characters graphemes and related Unicode representation issues .
fn demo(message: &str, s: &str) {
    println!("\n{}\n", message);
    println!("String: {}", s);
    println!("String length: {}", s.len());
    println!("Characters debug: {:?}", s.chars());
    println!("Characters count: {}", s.chars().count());
    println!("Characters reverse: {}", s.chars().rev().collect::<String>());
    println!("Graphemes vector: {:?}", s.graphemes(true).collect::<Vec<&str>>());
    println!("Graphemes count: {}", s.graphemes(true).count());
    println!("Graphemes reverse: {}", s.graphemes(true).rev().collect::<String>());
    println!("Lowercase: {}", s.to_lowercase());
    println!("Uppercase: {}", s.to_uppercase());
}
fn demo ( message : & str , s : & str ) { println ! ( " \n \n " message ) ; println ! ( " " s ) ; println ! ( " " s len ( ) ) ; println ! ( " " s chars ( ) ) ; println ! ( " " s chars ( ) count ( ) ) ; println ! ( " " s chars ( ) rev ( ) collect String ( ) ) ; println ! ( " " s graphemes ( true ) collect Vec str ( ) ) ; println ! ( " " s graphemes ( true ) count ( ) ) ; println ! ( " " s graphemes ( true ) rev ( ) collect String ( ) ) ; println ! ( " " s to_lowercase ( ) ) ; println ! ( " " s to_uppercase ( ) ) ; }
Print various information about a given string.
Print various information about a given string .
message
&str
s
&str
message
&str
s
&str