OpenBIMRL | General functions
Class path: text.compare
Compare

Description
Lexicographic check between character strings. Returns 0 if both sides are equal, less than 0 if object 0 is lexicographically smaller and otherwise greater than 1.
Input
| Input | Name | Typ | Description |
|---|---|---|---|
| 0 | Object A | Text | The text A for comparison with B. |
| 1 | Object B | Text | The text B for comparison with A. |
Output
| Output | Name | Typ | Description |
|---|---|---|---|
| 0 | Comparision | Integer | The comparative value as a Number. |
Use/Example
Analysis of the example "dog" and "cat":
- 'H' in "dog" has the Unicode value 72.
- 'K' in "cat" has the Unicode value 75.
- Since 72 < 75, "dog" is lexicographically smaller than "cat".
Answer: dog comes before cat