Skip to main content
Created for OutSystems 10. Not working on your version? Tell us about it!
OutSystems

How to find out if a string is contained in another string

How do I check if a certain text string contains another text string?
Is there an equivalent to the C# String.Contains function?

Answer

To know if one text string is contained in another text string use the Text Built-in Function Index.
The Index Function returns an integer with the zero-base position of a keyword string inside another text string and returns -1 if keyword is not found.

To get a Boolean Output similar to the C# String.Contains use the following Expression:

    Index(text,keyword) > -1

To make your search case insensitive set the ignoreCase parameter to True:

    Index(text,keyword,ignoreCase:True) > -1
  • Was this article helpful?