How to check if a string contains another string in LiveCode

Learn how to find out if a given string is in a different string in LiveCode in this quick and easy tutorial.

First, let’s define the two strings as follows:

put "hello" into tSearchTerm
put "this is a sample string!" into tString

To find out if tString contains tSearchTerm, perform the following:

if tString contains tSearchTerm then
	-- search term was found
end if

That’s all there is to it!

Love our articles? HostM offers professional and helpful web hosting services with unlimited features and renewal rates that actually match our advertised rates.