diff options
author | bptato <nincsnevem662@gmail.com> | 2022-01-22 18:34:23 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-01-22 18:34:23 +0100 |
commit | 7b06c22d8f24de727ce5b62b4d7fd8cd4007123d (patch) | |
tree | c92bd6243e249516ea51a0221c0e1b6c97adee48 /src/utils | |
parent | 4b5a3cbbf3ef3c75915f92d9ce487c0c9ff2884a (diff) | |
download | chawan-7b06c22d8f24de727ce5b62b4d7fd8cd4007123d.tar.gz |
Fix page navigation
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/twtstr.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index cb236b53..3050d50e 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -217,6 +217,14 @@ func skipBlanks*(buf: string, at: int): int = while result < buf.len and buf[result].isWhitespace(): inc result +func until*(s: string, c: char): string = + var i = 0 + while i < s.len: + if s[i] == c: + break + result.add(s[i]) + inc i + func number_additive*(i: int, range: HSlice[int, int], symbols: openarray[(int, string)]): string = if i notin range: return $i |