UT FindSubString

From Dragon Age Toolset Wiki
Jump to: navigation, search

Returns the position of a substring within a string.

int UT_FindSubString(
string sString,
string sSubString,
int nInstance = 1
);
Parameters:
sString
the string to search
sSubString
the substring to search for
nInstance
The instance of the substring to return (default is the first instance).
Returns:

the starting index of the specified instance of the substring. -1 on error.

Source:

Core Resources.utility_h

Description

Returns the starting index of the specified instance of the substring sSubstring within the string sString. Returns -1 if the specified instance of the substring does not occur in the string. The search is 0 indexed, so if the substring occurs at the very beginning of the string this function will return 0. 'UT_FindSubString("monkey_laser_fun", "_", 2);' would return 12.