Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.20

Description

Description:Sorts an array of strings in alphabetical order. Strings containing numbers are not properly sorted, and case is ignored. The sort is ordered according to Unicode character codes (ignoring case).

This function uses the quick sort algorithm.

The passed array is modified by reference.

To sort arrays of numbers, use fn vbs sortArray.

Syntax

Syntax:stringArray call fn_vbs_sortStrings
Parameters:
  • stringArray: Array - Array to sort.
Return Value:Array

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
["dEf", "bC", "abc"] call fn_vbs_sortStrings
// Returns: ["abc", "bC", "dEf"] 

Additional Information

See also: fn vbs sortArray
Multiplayer: 
Problems: 

Notes

An example of the sort order the function creates:

"1-02"
"1-2"
"1-20"
"10-20"
"fred"
"jane"
"pic   7"
"pic 4 else"
"pic 5"
"pic 5"
"pic 5 something"
"pic 6"
"pic01"
"pic02"
"pic02000"
"pic02a"
"pic05"
"pic100"
"pic100a"
"pic120"
"pic121"
"pic2"
"pic3"
"pic4"
"tom"
"x2-g8"
"x2-y08"
"x2-y7"
"x8-y8"