Skip to content

Commit a720c06

Browse files
committed
Fixes gh-914
1 parent 0246b11 commit a720c06

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/reference/reference_lua/string.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Below is a list of all additional ``string`` functions.
238238
239239
.. _string-split:
240240

241-
.. function:: split(input-string [, split-string])
241+
.. function:: split(input-string [, split-string, max])
242242

243243
Split ``input-string`` into one or more output strings
244244
in a table. The places to split are the places where
@@ -247,6 +247,7 @@ Below is a list of all additional ``string`` functions.
247247
:param input-string: (string) the string to split
248248
:param split-string: (string) the string to find within ``input-string``.
249249
Default = space.
250+
:param max - maximum number of delimiters to process counting from the beginning of the input string. Result will contain max + 1 parts maximum.
250251

251252
:Return: table of strings that were split from ``input-string``
252253
:Rtype: table
@@ -258,10 +259,11 @@ Below is a list of all additional ``string`` functions.
258259
tarantool> string = require('string')
259260
---
260261
...
261-
tarantool> string.split("A*BXX C", "XX")
262+
tarantool> string.split("one:two:three: four", ":", 2)
262263
---
263-
- - A*B
264-
- ' C'
264+
- - one
265+
- two
266+
- 'three: four'
265267
...
266268
267269
.. _string-strip:

0 commit comments

Comments
 (0)