mirror of
https://github.com/KumoCorp/kumomta.git
synced 2026-08-19 08:01:07 +00:00
18 lines
318 B
Markdown
18 lines
318 B
Markdown
# `kumo.string.splitn(STRING, LIMIT, PATTERN)`
|
|
|
|
{{since('2024.09.02-c5476b89')}}
|
|
|
|
Splits `STRING` by `PATTERN`, returning an array-style table
|
|
holding at most `LIMIT` substrings.
|
|
|
|
```lua
|
|
assert(
|
|
kumo.json_encode(kumo.string.splitn('Mary had a little lamb', 3, ' '))
|
|
== '["Mary","had","a little lamb"]'
|
|
)
|
|
```
|
|
|
|
|
|
|
|
|