Sunday, December 4, 2022

#1 2005-10-13 03:13:46 pm

From:: Malasaña, Madrid
Registered: 2002-11-20
Posts: 2014

How can I know if a specified string is contained in a text?

You can use several expressions:


set theText to "this is a sample"
set lookingFor to "sample"

offset of lookingFor in theText --> if result is not "0", then it is contained
theText contains lookingFor --> true or false, by default ignores case
lookingFor is in contents of theText --> the same

If you are looking for more options and power, take a look to the find text command of the Satimage osax, or use any command-line tool, such as grep.



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)