splitString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|= Comments ____________________________________________________________________________________________ | arma3dev |= Game name |1.49|= Game version ______________...")
 
(example)
Line 24: Line 24:


|x3= <code>"1:2:3" [[splitString]] ":"; // ["1","2","3"]</code>|= Example 3
|x3= <code>"1:2:3" [[splitString]] ":"; // ["1","2","3"]</code>|= Example 3
|x4= <code>["test","test"] [[joinString]] [[toString]] [12345] [[splitString]] [[toString]] [12345]; // ["test","test"]</code>|= Example 4
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 19:19, 4 August 2015

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 1.49|1.49]]
Hover & click on the images for description

Description

Description:
An SQF version of C++ strtok. Splits given string str into an array of tokens according to given delimeters.
Groups:
Uncategorised

Syntax

Syntax:
str splitString delimeters
Parameters:
str: String - A string to split
delimeters: String - one or more characters, each used as a separate delimeter.
Return Value:
Array

Examples

Example 1:
_str = "- This, is a sample string." splitString "-,. "; // ["This","is","a","sample","string"] _str joinString " "; // "This is a sample string"
Example 2:
"\A3\ui_f\data\map\vehicleicons\iconLogic_ca.paa" splitString "\."; // ["A3","ui_f","data","map","vehicleicons","iconLogic_ca","paa"]
Example 3:
"1:2:3" splitString ":"; // ["1","2","3"]
Example 4:
["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]

Additional Information

See also:
joinStringsetresizereverseselectinfindtoArrayforEachcountdeleteAtdeleteRangeappendsortparamparamsarrayIntersecttoStringUnicode Character Table

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

[[Category:Introduced with arma3dev version 1.49]][[ Category: arma3dev: New Scripting Commands | SPLITSTRING]][[ Category: arma3dev: Scripting Commands | SPLITSTRING]]

Notes

Bottom Section