BIS fnc sortAlphabetically: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (GVI 1.00 --> 1.10 http://dev.arma3.com/post/spotrep-00017)
m (Text replacement - "strings" to "Strings")
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.10


| arma3 |= Game name
|gr1= Arrays


|1.10|= Game version
|gr2= Strings
____________________________________________________________________________________________


| <pre>/*
|descr= Alphabetically sort an array of strings without modifying the original. See also [[sort]].


Description:
|s1= arrayOfStrings call [[BIS_fnc_sortAlphabetically]]
Sort an array of strings alphabetically


Parameter(s):
|p1= arrayOfStrings: [[Array]] of [[String]]s
ARRAY ot STRINGs


Returns:
|r1= [[Array]] of [[String]]s sorted alphabetically.
ARRAY ot STRINGs
*/


#define CONTROL ((finddisplay 0) displayctrl 1555)
|x1= <sqf>private _sortedNames = ["John", "Jane", "Julia", "Geronimo"] call BIS_fnc_sortAlphabetically; // will return ["Geronimo", "Jane", "John", "Julia"]</sqf>
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_sortAlphabetically]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[BIS_fnc_sortBy]] [[BIS_fnc_sortNum]] [[sort]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Arrays|{{uc:sortAlphabetically}}]]
[[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