Flexera beginner

How to find a string in Specific Position

How to find a string in Specific Position

For eg.) MyStr = "Testing"

If I pass parameter 4 to some function, it should return 't'. Anyway it can be done in install script?
Labels (1)
0 Kudos
1 Reply
Flexera beginner


There are a lot of ways you could do it using InstallScript String Functions
http:// helpnet.flexerasoftware.com/installshield21helplib/Subsystems/installshield21langref/helplibrary/LangrefString_functions.htm

Here is one example using CopyBytes
http:// helpnet.flexerasoftware.com/installshield21helplib/Subsystems/installshield21langref/helplibrary/LangrefCopyBytes.htm


prototype STRING ExFn_CopyBytes( byval STRING, // szMyString
byval NUMBER ); // nPos

// szMyString = the string you are searching
// nPos = the position in the string that you want
function STRING ExFn_CopyBytes( szMyString, nPos )
STRING szFoundStr;

// use 'number - 1' because CopyBytes is 0-based.
// passing "4" to find the "t" in "Testing" would actually be position 3
CopyBytes( szFoundStr, 0, szMyString, nPos - 1, 1 );

return szFoundStr;


0 Kudos