Solved

Finding a string within another

Posted on 2001-07-11
2
136 Views
Last Modified: 2010-04-06
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
Comment
Question by:Lmoen
2 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 30 total points
ID: 6274756
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
 

Author Comment

by:Lmoen
ID: 6275707
Thanks for the help
Appreciated
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
Process Javascript errors with Delphi TWebBrowser 1 113
Base1 Encode/Decode 3 68
How to load 2 images in same column in Delphi 2 35
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now