How to check if a string contains a given substring?

user441222 picture user441222 · Nov 22, 2012 · Viewed 12.5k times · Source

I need to find out if string contains a given substring.

For example, if I'm looking for the substring ABC in a string like this:

S := 'ABC String';

I should get result True, whilst for the following string I should get result False:

S := 'DEF String';

How to check if a string contains a substring in InnoSetup ?

Answer

Jan Doggen picture Jan Doggen · Nov 22, 2012

Innosetup has a Pos() function that works exactly like Delphi's. See the Support Functions Reference at http://www.jrsoftware.org/ishelp/index.php?topic=scriptfunctions