diff --git a/example/strings.hz b/example/strings.hz new file mode 100644 index 0000000..d04faaf --- /dev/null +++ b/example/strings.hz @@ -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;