The vgLib.findStr() system function searches for the first occurrence of a substring in a string.
vgLib.findStr() is one of a number of functions maintained for compatibility with earlier versions. New code can use standard EGL operators for these purposes.
vgLib.findStr(
source CHAR | DBCHAR | MBCHAR | UNICODE | NUM | HEX in,
sourceSubstringIndex INT inOut,
sourceSubstringLength INT in,
searchString CHAR | DBCHAR | MBCHAR | UNICODE | NUM | HEX in)
returns (result INT)
If searchString is found in the source substring, sourceSubstringIndex is set to indicate its location (the byte of the source where the matching substring begins). Otherwise, sourceSubstringIndex is not changed.
The following example searches for the characters "34" in the source string:
source CHAR(6);
search CHAR(2);
result, sourceIndex, sourceLength INT;
source = "123456";
sourceIndex = 1;
sourceLength = 6;
search = "34";
result = vgLib.findStr(source,sourceIndex,sourceLength,"34");
// result = 0, sourceIndex = 3