# stringlib::order

Sorting procedure for Sort

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```stringlib::order(`options`)
```

## Description

`stringlib::order()` returns a procedure that compares two strings and returns `TRUE` when they are in lexicographical order, otherwise `FALSE`. This procedure can be used as the second argument of `sort`.

## Examples

### Example 1

Sort strings in lexicographical order:

```sort(["ab", "a", "abc", "B", "ba", "Ca", "bB", "bb"], stringlib::order())```

Sort strings in lexicographical order without case sensitivity:

```sort(["ab", "a", "abc", "B", "ba", "Ca", "bB", "bb"], stringlib::order(Nocase))```

Sort strings in reverse lexicographical order:

```sort(["ab", "a", "abc", "B", "ba", "Ca", "bB", "bb"], stringlib::order(Reverse))```

Sort strings in reverse lexicographical order without case sensitivity:

```sort(["ab", "a", "abc", "B", "ba", "Ca", "bB", "bb"], stringlib::order(ReverseNocase))```

## Options

 `Lexicographical` Return a procedure that yields `TRUE` when the two given strings are in lexicographical order. `Nocase` Return a procedure that yields `TRUE` when the two given strings are in lexicographical order without case sensitivity. `Reverse` Return a procedure that yields `TRUE` when the two given strings are in reverse lexicographical order. `ReverseNocase` Return a procedure that yields `TRUE` when the two given strings are in reverse lexicographical order without case sensitivity.

## Return Values

Procedure that can be used as second argument of `sort`