-
-
Save velotiotech/6f83d97f116eb684982d1270a0e8a178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn get_char(data: String) -> char { | |
data.chars().last().unwrap() | |
} | |
fn string_uppercase(mut data: &String) { | |
data = data.to_uppercase(); | |
println!("{data}"); | |
} | |
fn main() { | |
let data = "Rust is great!".to_string(); | |
get_char(data); | |
string_uppercase(&data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment