Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/9260938 to your computer and use it in GitHub Desktop.
Save tenderlove/9260938 to your computer and use it in GitHub Desktop.
fn yay(left: &str) {
for (idx, c) in left.char_indices() {
println!("{} {}", idx, c);
}
}
fn main() {
yay("hello !!! こんにちは!");
}
[aaron@higgins rustfun]$ ./hello
0 h
1 e
2 l
3 l
4 o
5
6 !
7 !
8 !
9
10 こ
13 ん
16 に
19 ち
22 は
25 !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment