Solved

Finding a string within another

Posted on 2001-07-11
2
137 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Downloading email attachments 2 73
Firemonkey DbLookupComboBox equivalent ? 2 47
Tidtcpserver listening on multiports? 1 26
Twebbrowser add css to the header 3 24
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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