more baics

This commit is contained in:
Alter 2026-09-10 17:51:05 +02:00
parent 0954301d8c
commit 5bcb7748b6
5 changed files with 20 additions and 0 deletions

View File

@ -21,3 +21,7 @@ path = "vec.rs"
[[bin]]
name = "strings"
path = "strings.rs"
[[bin]]
name = "multilingual"
path = "multilingual.rs"

BIN
multilingual Executable file

Binary file not shown.

13
multilingual.rs Normal file
View File

@ -0,0 +1,13 @@
fn main() {
let multilingual = "Hi! ¡Hola! привет!";
let maybe = multilingual.find('п');
if maybe.is_some() {
let hi = &multilingual[maybe.unwrap()..];
let hio = &multilingual[11..13];
println!("hio {}", hio);
println!("hello russkov {}", hi)
}
}

BIN
strings

Binary file not shown.

View File

@ -8,6 +8,7 @@ fn array_to_string(arr: &[i32]) -> String {
res += ", "
}
res.pop();
res.pop();
res.push(']');
res
}
@ -23,4 +24,6 @@ fn main() {
let arr2 = &[3, 2, 1, 0, -1];
let res = array_to_string(arr2);
let formated = format!("hello {}", res);
println!("{}", formated);
}