[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

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
0
Lmoen
Asked:
Lmoen
1 Solution
 
EpsylonCommented:
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now