strSubMask Function
Use
Purpose
Returns a substring from a given string and encodes special characters.
Syntax
string strSubMask (in string string,
in int position,
in int length)
Parameters
|
string |
Expression evaluating to a string. |
|
position |
Starting position of the substring within string [1..n]. |
|
length |
Number of characters to put into the substring starting at position. |
Special Characters
|
Character |
Encoding |
|
< |
< |
|
> |
> |
|
& |
& |
|
% |
% |
|
SPACE |
|
|
- |
- |
|
" |
" |
Description
When you can specify the starting position position and length length, strSubMask returns the length length, starting at the position you request.
-
If you specify a length of 0, strSubMask returns all characters from the starting position to the end of the string.
-
If length is greater than the number of characters in the source string, strSubMask uses all characters up to the end of the string.
Return Value
Returns a substring (a copy) of the given string.
Example
`name = "Walt Whitman"` The last name of `name` is
`if (0 != (j = strstr (name, " ")))`
`strSubMask (name, j + 1, 0)`
`else`
undefined.
`end`