mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2026-08-22 14:13:28 +08:00
reorganized the directories
This commit is contained in:
8
projects/string_demo/Cargo.toml
Normal file
8
projects/string_demo/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "string_demo"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
11
projects/string_demo/src/main.rs
Normal file
11
projects/string_demo/src/main.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
fn main() {
|
||||
let s = "नमस्ते";
|
||||
|
||||
for c in s.chars() {
|
||||
println!("{}", c);
|
||||
}
|
||||
|
||||
for b in s.bytes() {
|
||||
println!("{}", b);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user