This type can be used as the key in a TreeMap to provide case sensitive map lookups.
Normally, all Lasso string comparisons are non-case-sensitive which makes 'one' equal to 'ONE'. Storing both of those values in a map will result in them being interpreted as the same value, so the second inserted pair will replace the first. By using the TreeMap and caseKey types, 'one' and 'ONE' will be treated as distinct values.
This caseKey type needs to be used as the key for the map when both inserting and finding. Also, this method will not work with the regular 'Map' type, since it will always convert its keys into strings. The TreeMap type will preserve the key's original type.
Parameters
-p
string, required
The string to be used as the comparison value.
Sample Usage
treemap(caseKey('one')=1, caseKey('ONE')=2)->find(caseKey('ONE')); // found
treemap(caseKey('one')=1, caseKey('ONE')=2)->find(caseKey('oNe')); // not found
treemap(caseKey('one')=1, caseKey('ONE')=2)->find(caseKey('one')); // found
Source Code
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.