splitString
Jump to navigation
Jump to search
Description
- Description:
- An SQF version of C++ strtok. Splits given string str into an array of tokens according to given delimeters. In addition, if empty string "" is used for delimiters, str is split by each character.
- 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"]
- Example 5:
"Japa is the best!" splitString "" joinString " "; // "J a p a i s t h e b e s t !"
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]]