Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I search a string for a letter?

Status
Not open for further replies.

jvff

Programmer
Apr 1, 2001
64
BR
Hello,
I am making a PC Player program (see for more info) and I need to read a command from a file. I loaded it into MemoHidden and now I need to check MemoHidden.Lines.Strings[1] to see if it has the character '(' and the position it is to SetLen to remove the characters '(' and after '('. How do I check the pos of '(' ? Please help me. ThanQ, ;-)

JVFF (Janito Vaqueiro Ferreira Filho)
 
Hi

Simply use POS function
e.g
yourstring:=MemoHidden.Lines.Strings[1];
i:=POS('(',yourstring);

Bye
 
Check out faq218-360 about strings operations in the pascal forum

Regards S. van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top