mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
Create strings.hz
This commit is contained in:
parent
cd722dc1c1
commit
7a9671ea25
16
example/strings.hz
Normal file
16
example/strings.hz
Normal 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;
|
Loading…
Reference in a new issue