BIS fnc splitString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page filling)
m (template:command argument fix)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Split spring according to given separators |= Description
| Split spring according to given separators |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [stringToSplit, separators, byStr] call [[BIS_fnc_splitString]] |= Syntax
| [stringToSplit, separators, byStr] call [[BIS_fnc_splitString]] |SYNTAX=


|p1= stringToSplit: [[String]] |= Parameter 1
|p1= stringToSplit: [[String]] |PARAMETER1=


|p2= separators: [[String]] - (Optional, default "") each letter in it '''is''' a separator if ''byStr'' is [[false]]; not the whole word itself |= Parameter 2
|p2= separators: [[String]] - (Optional, default "") each letter in it '''is''' a separator if ''byStr'' is [[false]]; not the whole word itself |PARAMETER2=


|p3= byStr: [[Boolean]] - (Optional, default [[false]]) use [[splitString]] if set to [[true]] |= Parameter 3
|p3= byStr: [[Boolean]] - (Optional, default [[false]]) use [[splitString]] if set to [[true]] |PARAMETER3=


| [[Array]] of [[String|Strings]] |= Return value
| [[Array]] of [[String|Strings]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>["this is a test", " "] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["this", "is", "a", "test"]}}</code> |= Example 1
|x1= <code>["this is a test", " "] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["this", "is", "a", "test"]}}</code> |EXAMPLE1=


|x2= <code>["this is a test", "st"] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["hi"," i"," a ","e"]}}</code> |= Example 2
|x2= <code>["this is a test", "st"] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["hi"," i"," a ","e"]}}</code> |EXAMPLE2=


|x3= <code>["this is a test", "is"] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a te","t"]}}</code> |= Example 3
|x3= <code>["this is a test", "is"] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a te","t"]}}</code> |EXAMPLE3=


|x4= <code>["this is a test", "is", [[true]]] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a test"]}}</code> |= Example 4
|x4= <code>["this is a test", "is", [[true]]] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a test"]}}</code> |EXAMPLE4=


____________________________________________________________________________________________
____________________________________________________________________________________________


| [[splitString]], [[toArray]], [[toString]] |= See also
| [[splitString]], [[toArray]], [[toString]] |SEEALSO=
}}
}}



Revision as of 14:33, 7 April 2019

Hover & click on the images for description

Description

Description:
Split spring according to given separators
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[stringToSplit, separators, byStr] call BIS_fnc_splitString
Parameters:
stringToSplit: String
separators: String - (Optional, default "") each letter in it is a separator if byStr is false; not the whole word itself
byStr: Boolean - (Optional, default false) use splitString if set to true
Return Value:
Array of Strings

Examples

Example 1:
["this is a test", " "] call BIS_fnc_splitString; // returns ["this", "is", "a", "test"]
Example 2:
["this is a test", "st"] call BIS_fnc_splitString; // returns ["hi"," i"," a ","e"]
Example 3:
["this is a test", "is"] call BIS_fnc_splitString; // returns ["th"," "," a te","t"]
Example 4:
["this is a test", "is", true] call BIS_fnc_splitString; // returns ["th"," "," a test"]

Additional Information

See also:
splitStringtoArraytoString

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

Notes

Bottom Section