Finding a string within another

Just wondering, is there a method in Delphi whereby I can determine whether a string is in another.

Say I've got the string1 as "ask", and string2 as "ask a question in the delphi programming topic area", is there a command whether I can determine if "ask" is in the second string, or is this something I have to program manually...?

Thanks for the help
LmoenAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
EpsylonConnect With a Mentor Commented:
You can use the Pos function. It returns the position of the first match:

Label1.Caption := IntToStr(Pos('ask', 'ask a question in the delphi programming topic area'));
0
 
LmoenAuthor Commented:
Thanks for the help
Appreciated
0
All Courses

From novice to tech pro — start learning today.