string.split

From Minetest Developer Wiki
Jump to navigation Jump to search

Syntax

<source> string.split(str, separator) </source>

Description

Splits a string using the given separator string, returning an array (sequential table) of sub-strings.

Parameters:

  • str — The string to split.
  • separator — The sub-string to look for to split the string.

Example 1

<source> string.split("a,b", ",") == {"a","b"} </source>