splitString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (fixed typos (delimeter -> delimiter))
(typo)
Line 13: Line 13:


|p1= str: [[String]] - A string to split |= Parameter 1
|p1= str: [[String]] - A string to split |= Parameter 1
|p2= delimeters: [[String]] - one or more characters, each used as a separate delimiter. |= Parameter 2
|p2= delimiters: [[String]] - one or more characters, each used as a separate delimiter. |= Parameter 2
| [[Array]] |= Return value
| [[Array]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________

Revision as of 22:14, 12 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 delimiters. In addition, if empty string "" is used for delimiters, str is split by each character.
Groups:
Uncategorised

Syntax

Syntax:
str splitString delimiters
Parameters:
str: String - A string to split
delimiters: String - one or more characters, each used as a separate delimiter.
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]]

Notes

Bottom Section