No edit summary |
|||
Line 2: | Line 2: | ||
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> |
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> |
||
+ | Splits a string using a delimiter |
||
− | One line summary description of function. |
||
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> |
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> |
||
− | + | s1, s2, s3 ... sn = strsplit("delimiter", "subject") |
|
Revision as of 18:54, 20 September 2007
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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) }