From 3e9479f7cff80b78f1e5ffc31a283e68828157a1 Mon Sep 17 00:00:00 2001 From: Vinicius Silva Date: Tue, 26 Dec 2023 17:36:27 -0300 Subject: [PATCH] runes.v implemented --- 03_variables/runes.v | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 03_variables/runes.v diff --git a/03_variables/runes.v b/03_variables/runes.v new file mode 100644 index 0000000..511d0bf --- /dev/null +++ b/03_variables/runes.v @@ -0,0 +1,21 @@ +pub fn main() +{ + rocket := `🚀` + assert rocket.str() == '🚀' + println(rocket) + + assert rocket.bytes() == [u8(0xf0),0x9f, 0x9a,0x80] + + assert `\x61` == `a` + assert `\x141` == `a` + assert `\x0061` == `a` + + rocket_string := '🚀' + assert rocket_string[0] != `🚀` + assert 'aloha!'[0] == `a` + + hello := 'Hello World 👋' + hello_runes := hello.runes() + assert hello_runes.string() == hello + +} \ No newline at end of file