diff options
| author | unwox <me@unwox.com> | 2024-10-15 16:33:46 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-10-15 16:33:46 +0600 |
| commit | 414dd4680363dd1577ebf9733263c71402eae4e4 (patch) | |
| tree | 9300e3d868afd239dbd205c8ed28f40d438212e2 /lib/string.fnl | |
| parent | 92d95b978bfb10fd29024d0adda7b28f125e08b8 (diff) | |
improve spellfix
Diffstat (limited to 'lib/string.fnl')
| -rw-r--r-- | lib/string.fnl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/string.fnl b/lib/string.fnl index ca29da0..1696a64 100644 --- a/lib/string.fnl +++ b/lib/string.fnl @@ -8,8 +8,8 @@ (= "string" (type str)) (string.format "letters(): str must be string, %s given" (type str))) (var result []) - (for [i 1 (must (luna.utf.len str))] - (table.insert result (must (luna.utf.sub str i 1)))) + (for [i 1 (must (luna.utf8.len str))] + (table.insert result (must (luna.utf8.sub str i 1)))) result) (fn split [str] @@ -27,9 +27,9 @@ (fn truncate [str len ellipsis] (if (and (= (type str) "string") (< 0 (# str))) - (if (< (must (luna.utf.len str)) len) + (if (< (must (luna.utf8.len str)) len) str - (.. (trim (must (luna.utf.sub str 1 len))) (or ellipsis "..."))) + (.. (trim (must (luna.utf8.sub str 1 len))) (or ellipsis "..."))) "")) {: letters : empty? : split : ends-with : trim : truncate} |
