GetSubString() NWScript command extracts a portion of a string as a new string.
If an error is encountered (such as trying to obtain a string of negative length), a zero-length string, "", is returned.
string GetSubString (string sString, int nStart
- The string from which a substring will be extracted.
- The character of
sStringat which the substring begins. This is zero-based, so the first character is 0, the second is 1, etc.
- The number of characters to be extracted.
If the requested substring goes beyond the end of the original string, as in
GetSubString("test", 2, 1024), then the returned string consists of what is available, as in
"st" for this example. In this case, the length of the returned string can be less than
nCount without being zero.