Skip to content

Commit 5229ade

Browse files
Working with strings
1 parent 897ab68 commit 5229ade

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "strings"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
fn main() {
2+
let first_message = "Hello ";
3+
let second_message = "Rustaceans";
4+
5+
let string_one = String::from(first_message);
6+
let string_two = second_message.to_string();
7+
8+
9+
let final_string = string_one + &string_two;
10+
println!("Final string: {}", final_string);
11+
12+
for character in final_string.chars() {
13+
println!("{}", character);
14+
}
15+
}

0 commit comments

Comments
 (0)