Policies & Guidelines

SORT_CASE_SENSITIVE

Sort an array of strings or numbers (case-sensitive)

Description

Returns an array containing all the values in the given array of strings or numbers, sorted in order. The function takes letter case into account.

Function signature

SORT_CASE_SENSITIVE(array: Array<number>|Array<string>, order: String = asc) => Array

Parameter

Description

Array

Array to sort

Order

Order to sort in ("asc" for ascending, "desc" for descending)

Examples

array = [10,1,2,6,-1,10,12]
textArray = ["ABCD","CC","bb","AA","a","aa","abcd"]

Formula

Return value

SORT_CASE_SENSITIVE(array)

[-1,1,2,6,10,10,12]

SORT_CASE_SENSITIVE(array, "desc")

[12,10,10,6,2,1,-1]

SORT_CASE_SENSITIVE(textArray)

["a","aa","AA","abcd","ABCD","bb","CC"]