Answers for "rust loop over string"

0

rust loop over string

let hello = "नमस्ते";
// Characters
for c in hello.chars() {
    println!("{}", c);
}
// Bytes
for b in hello.bytes() {
    println!("{}", b);
}
Posted by: Guest on January-15-2022

Browse Popular Code Answers by Language