BIS fnc sortAlphabetically: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "^ \{\{(Command|Function)" to "{{$1")
m (Text replacement - "strings" to "Strings")
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.10


|1.10|= Game version
|gr1= Arrays


|gr1 = Arrays |GROUP1=
|gr2= Strings


|gr2 = Strings |GROUP2=
|descr= Alphabetically sort an array of strings without modifying the original. See also [[sort]].


| Alphabetically sort an array of strings without modifying the original. See also [[sort]]. |DESCRIPTION=
|s1= arrayOfStrings call [[BIS_fnc_sortAlphabetically]]


| arrayOfStrings call [[BIS_fnc_sortAlphabetically]] |SYNTAX=
|p1= arrayOfStrings: [[Array]] of [[String]]s


|p1= arrayOfStrings: [[Array]] of [[String|strings]] |PARAMETER1=
|r1= [[Array]] of [[String]]s sorted alphabetically.


| [[Array]] of [[String|strings]] sorted alphabetically. |RETURNVALUE=
|x1= <sqf>private _sortedNames = ["John", "Jane", "Julia", "Geronimo"] call BIS_fnc_sortAlphabetically; // will return ["Geronimo", "Jane", "John", "Julia"]</sqf>
 
|x1= <code>_sortedNames = ["John", "Jane", "Julia", "Geronimo"] call [[BIS_fnc_sortAlphabetically]]; {{codecomment|// will return ["Geronimo", "Jane", "John", "Julia"]}}</code> |EXAMPLE1=
 
| [[BIS_fnc_sortBy]], [[BIS_fnc_sortNum]], [[sort]] |SEEALSO=


|seealso= [[BIS_fnc_sortBy]] [[BIS_fnc_sortNum]] [[sort]]
}}
}}
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:sortAlphabetically}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:sortAlphabetically}}]]

Latest revision as of 15:48, 8 November 2023

Hover & click on the images for description

Description

Description:
Alphabetically sort an array of strings without modifying the original. See also sort.
Execution:
call
Groups:
ArraysStrings

Syntax

Syntax:
arrayOfStrings call BIS_fnc_sortAlphabetically
Parameters:
arrayOfStrings: Array of Strings
Return Value:
Array of Strings sorted alphabetically.

Examples

Example 1:
private _sortedNames = ["John", "Jane", "Julia", "Geronimo"] call BIS_fnc_sortAlphabetically; // will return ["Geronimo", "Jane", "John", "Julia"]

Additional Information

See also:
BIS_fnc_sortBy BIS_fnc_sortNum sort

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