WoW API: strsplit

Revision as of 18:51, 20 September 2007 by WoWWiki>WoWWiki-Tattersail (New page: {{wowapi}} __NOTOC__ <!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> One line summary description of function. <!-- List return values an...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < strsplit

Splits a string using a delimiter

s1, s2, s3 ... sn = strsplit("delimiter", "subject")


Arguments

(delimiter, subject)
delimiter
String - Delimiter
subejct
String - String to split


Returns

A list of strings. Not a table.

Example

local a, b, c = strsplit(",", "a b c")

Result

a = "a"
b = "b"
c = "c"

Details

To get a table use:

local tbl = { strsplit(delimiter, subject) }