summaryrefslogtreecommitdiffstats
path: root/examples/11_str.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-07-02 02:54:21 -0400
committerJesse Luehrs <doy@tozt.net>2014-07-02 02:54:21 -0400
commite620daf3b1a40ae825c625bc4328fb7d2b3ee8b6 (patch)
treefaa469408ee78623eaa8d2720dcbb36096788ca1 /examples/11_str.rs
downloadintro-to-rust-yapc-na-2014-e620daf3b1a40ae825c625bc4328fb7d2b3ee8b6.tar.gz
intro-to-rust-yapc-na-2014-e620daf3b1a40ae825c625bc4328fb7d2b3ee8b6.zip
initial commitHEADmaster
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);
+}
+