diff options
| author | Kai Gunger <kgunger12@gmail.com> | 2026-07-11 16:17:57 -0400 |
|---|---|---|
| committer | Kai Gunger <kgunger12@gmail.com> | 2026-07-11 16:17:57 -0400 |
| commit | f56c11b48ac6ef65622d38da2d8d8ff04dd4049d (patch) | |
| tree | c599c9c2986f240187c403cf4eb2ffed0d1678f4 /text | |
| parent | fd5d79d8a2e438fac351099553438ed071d63d84 (diff) | |
Diffstat (limited to 'text')
| -rw-r--r-- | text/cstr.tnsl | 31 | ||||
| -rw-r--r-- | text/text.tnsl | 5 |
2 files changed, 36 insertions, 0 deletions
diff --git a/text/cstr.tnsl b/text/cstr.tnsl new file mode 100644 index 0000000..67db577 --- /dev/null +++ b/text/cstr.tnsl @@ -0,0 +1,31 @@ + +/; cstr_cmp (~uint8 a, b) [bool] + /; loop (a` == b` && a` !== 0 && b` !== 0) [a++; b++] ;/ + + /; if (b` == 0 && a == 0) + return true + ;/ + + return false +;/ + +/; cstr_len (~uint8 a) [uint] + uint out = 0 + /; loop (str` !== 0) [str++; out++] ;/ + return out +;/ + +/; cstr_starts_with (~uint8 str, prefix) [bool] + int chk = cstr_len(suffix) + int counter = 0 + + /; loop (str` !== 0) [str++] + ;/ + +/; cstr_ends_with (~uint8 str, suffix) [bool] + int chk = cstr_len(suffix) + int counter = 0 + + /; loop (str` !== 0) [str++] + ;/ +;/ diff --git a/text/text.tnsl b/text/text.tnsl new file mode 100644 index 0000000..951e697 --- /dev/null +++ b/text/text.tnsl @@ -0,0 +1,5 @@ + +/; module text + import "cstr.tnsl" +;/ + |