Advertisement
cwchen

[Rust] Iterate an array with indexs.

Aug 22nd, 2017
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. fn main() {
  2. // Numbers in German
  3. let array = ["eins", "zwei", "drei", "vier", "fünf"];
  4.  
  5. for i in 0..array.len() {
  6. println!("{}", array[i]);
  7. }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement