ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. split

Function

split

Server and clientMiscellaneousIdentical to MTA:SA

Splits text into parts by a separator and returns a table. The separator is a string (each of its characters splits the text) or a character code, e.g. 32 for a space. Empty parts are skipped.

Syntax

table split(string input, string|int separator)

Arguments

inputstring
The text.
separatorstring|int
A separator or a character code.

Returns

A table of parts.

Example

local parts = split("Grove Street,Ballas,Vagos", ",")
outputServerLog(#parts) -- 3

See also