Topic complex |
String functions |
Function |
swap() |
Short |
Inversion of a string with reference to the start of sorting |
Syntax |
SWAP(s : STRING) : STRING |
Parameter |
s : any string |
Return |
s, if s includes no '^',
otherwise 'b^a', if s has the form 'a^b'. |
See also: |
|
Description |
The databases of the TDB family support the sign of start of sorting '^' in strings. That means that strings in the form 'a^b' are not sorted under 'a...' but under 'b...'. At sorting surch strings a SWAP(...) is executed internal.
Example: A typical case of a problem are titles of nobility in name fields. The name 'von Eisenstein' is normally sorted under 'von...' thus a search over indices for 'Eisenstein' would fail. But is the name entered as 'von^Eisenstein' the name is sorted under 'Eisenstein...' and also found.
|