Vicon Shogun banner

Description

Alphabetically sort a list of strings stored in an array. The sorting will be case sensitive, meaning that the letters A-Z will get sorted before a-z.

Functional area

System

Command syntax

Syntax

sortStrings stringArray [-d] [-numeric]

Arguments

NameTypeRequiredComments
stringArraystring arrayyesThe array to sort

Flags

NameFlag argumentsArgument typeExclusive toComments
d0Sorts in descending order. Default is to sort in ascending order.
numeric


Sorts strings numerically

Return value

string array

Examples

// Demonstrate a simple sort.
string $array[3;
$array[0] = "apple";
$array[1] = "Berry;
$array[2] = "Apple";
string $sortedArray[] = `sortStrings $array`;
print $sortedArray;

Additional information

Related commands