Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a string contains a given substring?

Tags:

inno-setup

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 ?

like image 860
user441222 Avatar asked Nov 22 '12 06:11

user441222


People also ask

How do you check if a string contains a specific substring?

The easiest and most effective way to see if a string contains a substring is by using if ... in statements, which return True if the substring is detected. Alternatively, by using the find() function, it's possible to get the index that a substring starts at, or -1 if Python can't find the substring.

How do you check if a string contains a substring in Java?

The Java String contains() method is used to check whether the specific set of characters are part of the given string or not. It returns a boolean value true if the specified characters are substring of a given string and returns false otherwise. It can be directly used inside the if statement.

How do you check if a string contains a substring in C++?

Check if a string contains a sub-string in C++This find() method returns the first location where the string is found. Here we are using this find() function multiple times to get all of the matches. If the item is found, this function returns the position. But if it is not found, it will return string::npos.

How do I check if a string contains?

The includes() method returns true if a string contains a specified string. Otherwise it returns false . The includes() method is case sensitive.


1 Answers

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

like image 84
Jan Doggen Avatar answered Sep 25 '22 15:09

Jan Doggen