diff options
| author | gingerBill <bill@gingerbill.org> | 2019-10-06 18:13:15 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-10-06 18:13:15 +0100 |
| commit | 4e8a801b3504f402e06d6928e889b33c7872f88f (patch) | |
| tree | 1fd1c1484a1e4fa9bdf957a4a1ad3cbd324a4dc5 /examples | |
| parent | e1b711b3b3476ecde0ed7e64e65fe4314a702b61 (diff) | |
strings.split; strings.index; eprint* over print*_err;
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/demo/demo.odin | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index eec7da45a..2c8148501 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -4,6 +4,7 @@ import "core:fmt" import "core:mem" import "core:os" import "core:reflect" +import "core:strings" import "intrinsics" when os.OS == "windows" { @@ -1189,7 +1190,15 @@ where_clauses :: proc() { } main :: proc() { - when true { + x := "foobarbaz"; + i : int; + i = strings.last_index(x, "foo"); fmt.println(i); + i = strings.last_index(x, "bar"); fmt.println(i); + i = strings.last_index(x, "baz"); fmt.println(i); + i = strings.last_index(x, "asd"); fmt.println(i); + i = strings.last_index(x, "a"); fmt.println(i); + i = strings.last_index(x, "ba"); fmt.println(i); + when false { general_stuff(); union_type(); parametric_polymorphism(); @@ -1212,3 +1221,4 @@ main :: proc() { where_clauses(); } } + |