Answers for "char to upper case rust"

0

char to upper case rust

let c: char = 'i';
let vec_upper: Vec<char> = c.to_uppercase().collect(); // vec_upper = ['I']
// if in the language you're working the uppercase of a char is always one char
let c_upper = vec_upper[0]; // c_upper = 'I'
// more in general you would put all the chars in vec_upper in a string
Posted by: Guest on March-26-2022

Browse Popular Code Answers by Language