awtk/tests/fscripts/demo_str.fs
2021-07-16 07:31:17 +08:00

12 lines
465 B
GLSL

assert(len("abc") == 3)
assert(substr("abcd", 0, 2) == "ab")
assert(index_of('aaa bbb aaa bbb', 'bbb') == 4);
assert(last_index_of('aaa bbb aaa bbb', 'bbb') == 12);
assert(char_at("", 0) == '')
assert(char_at("", 1) == '')
assert(char_at("", 2) == '')
assert(char_at("", 3) == '')
assert(char_at("", -1) == '')
assert(char_at("", -2) == '')
assert(char_at("abc", -2) == 'b')