BIS fnc splitString: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Page filling) |
m (template:command argument fix) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Split spring according to given separators |= | | Split spring according to given separators |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [stringToSplit, separators, byStr] call [[BIS_fnc_splitString]] |= | | [stringToSplit, separators, byStr] call [[BIS_fnc_splitString]] |SYNTAX= | ||
|p1= stringToSplit: [[String]] |= | |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 |= | |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]] |= | |p3= byStr: [[Boolean]] - (Optional, default [[false]]) use [[splitString]] if set to [[true]] |PARAMETER3= | ||
| [[Array]] of [[String|Strings]] |= | | [[Array]] of [[String|Strings]] |RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>["this is a test", " "] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["this", "is", "a", "test"]}}</code> |= | |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> |= | |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> |= | |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> |= | |x4= <code>["this is a test", "is", [[true]]] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a test"]}}</code> |EXAMPLE4= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[splitString]], [[toArray]], [[toString]] |= | | [[splitString]], [[toArray]], [[toString]] |SEEALSO= | ||
}} | }} | ||
Revision as of 14:33, 7 April 2019
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