Create strings.hz

pull/4/head
Natapat Samutpong 2022-03-27 07:22:52 +07:00
parent cd722dc1c1
commit 7a9671ea25
1 changed files with 16 additions and 0 deletions

16
example/strings.hz Normal file
View File

@ -0,0 +1,16 @@
fun main: void = do
let str: string = "Hello, World";
-- Matching string(s)
match str with
| "Hello, World" -> @write("yes\n");
| else @write("no\n");
end;
-- Indexing character in string
let foo: string = @get(str, 0);
match foo with
| "H" -> @write("still yes");
| else @write("no H");
end;
end;