The 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.

Definition Edit

string GetSubString (string sString, int nStart,
int nCount)

string sString 
The string from which a substring will be extracted.
int nStart 
The character of sString at which the substring begins. This is zero-based, so the first character is 0, the second is 1, etc.
int nCount 
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.

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.