strlcslen(X;Y)
Returns the length of the longest contiguous substring that appears in two given strings.
Syntax
strlcslen(X;Y)
bstrlcslen(X;Y)
Input
| Argument | Type | Description |
|---|---|---|
X |
text | The first of the two strings in which to determine the length of the longest
contiguous substring A scalar value or the name of a column |
Y |
text | The second of the two strings in which determine the length of the longest
contiguous substring A scalar value or the name of a column |
Return Value
Returns the integer value corresponding to the length of the longest contiguous substring
that appears in both X and Y. Returns
0 if there is no common substring.
If X or Y is N/A, the result is
0.
Sample Usage
string1 |
string2 |
strlcslen(string1;string2) |
|---|---|---|
| 'appliance' | 'compliant' | 5 |
| 'affluent' | 'afferent' | 3 |
| 'mouse' | 'lion' | 1 |
| 'mouse' | 'cat' | 0 |
| '' | 'cat' | 0 |
| 'mouse' | '' | 0 |
Additional Information
strlcslenis Unicode (UTF-8) compliant and will work with Unicode or plain ASCII text fields.- If passed a string argument that is not legal Unicode, it will by default signal an error (configurable as a user preference).
- A corresponding function
bstrlcslencan be used with non-Unicode strings (e.g., binary or legacy encodings).
