diff options
Diffstat (limited to 'toot-toot.tlv')
-rw-r--r-- | toot-toot.tlv | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/toot-toot.tlv b/toot-toot.tlv index bb5ea56..0e524db 100644 --- a/toot-toot.tlv +++ b/toot-toot.tlv @@ -149,6 +149,29 @@ > return tostring(x) >end - __teliva_timestamp: original + find_index: + >function find_index(arr, x) + > for n, y in ipairs(arr) do + > if x == y then + > return n + > end + > end + >end +- __teliva_timestamp: original + trim: + >function trim(s) + > return s:gsub('^%s*', ''):gsub('%s*$', '') + >end +- __teliva_timestamp: original + split: + >function split(s, d) + > result = {} + > for match in (s..d):gmatch("(.-)"..d) do + > table.insert(result, match); + > end + > return result + >end +- __teliva_timestamp: original map: >-- only for arrays >function map(l, f) @@ -192,29 +215,6 @@ > return result >end - __teliva_timestamp: original - find_index: - >function find_index(arr, x) - > for n, y in ipairs(arr) do - > if x == y then - > return n - > end - > end - >end -- __teliva_timestamp: original - trim: - >function trim(s) - > return s:gsub('^%s*', ''):gsub('%s*$', '') - >end -- __teliva_timestamp: original - split: - >function split(s, d) - > result = {} - > for match in (s..d):gmatch("(.-)"..d) do - > table.insert(result, match); - > end - > return result - >end -- __teliva_timestamp: original sort_letters: >function sort_letters(s) > tmp = {} |