summaryrefslogtreecommitdiffstats
path: root/examples/11_str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/11_str.rs')
-rw-r--r--examples/11_str.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/11_str.rs b/examples/11_str.rs
new file mode 100644
index 0000000..7b40fc4
--- /dev/null
+++ b/examples/11_str.rs
@@ -0,0 +1,8 @@
+fn main () {
+ let mut s = String::from_str("Hello");
+ s.push_str(" world");
+
+ println!("{}", s.len());
+ println!("{}", s);
+}
+