BIS fnc splitString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Split spring according to given separators |= Description
____________________________________________________________________________________________
 
| [stringToSplit, separators, byStr] call [[BIS_fnc_splitString]] |= Syntax


Description:
|p1= stringToSplit: [[String]] |= Parameter 1
Split spring according to given separators


Parameter(s):
|p2= separators: [[String]] - (Optional, default "") each letter in it '''is''' a separator if ''byStr'' is [[false]]; not the whole word itself |= Parameter 2
1: STRING - affected string
2: STRING - one or more separators


Returns:
|p3= byStr: [[Boolean]] - (Optional, default [[false]]) use [[splitString]] if set to [[true]] |= Parameter 3
ARRAY of STRINGs
 
*/
| [[Array]] of [[String|Strings]] |= Return value
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


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


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


| |= Return value
|x3= <code>["this is a test", "is"] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a te","t"]}}</code> |= Example 3
____________________________________________________________________________________________
 
|x4= <code>["this is a test", "is", [[true]]] [[call]] [[BIS_fnc_splitString]]; {{codecomment|// returns ["th"," "," a test"]}}</code> |= Example 4


|x1= <code></code> |=
____________________________________________________________________________________________
____________________________________________________________________________________________


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



Revision as of 09:19, 7 May 2018

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