HomeOutSystemsHow to find if string contains another string in Outsystems ?

How to find if string contains another string in Outsystems ?

There are times when you want to check if a string exists in another string when working with the OutSystems application. In C# , we have the method string.Contains which does the similar task easily.

How to find if string contains another string in Outsystems ?

You can use the Built-in Text function called “Index” to find out if one string is contained in another.

This function returns the position of the string keyword that is found in another string. If the string is not found , it returns -1.

If you need to get the same behaviour as the String.Contains , then you can use the below code.

Index(<string>,<keyword to search>) > -1

Eg:

Index("Welcome to DeveloperPublish.com","to") > -1

Leave a Reply

You May Also Like

Outsystems provides plenty of built-in date functions and one such function is the DateTimeToDate function used to convert DateTime to...
When working with the API’s in Outsystems , there are times when you might want to transfer the UserAgent from...