[Webinar] Streamline your web hosting managementRegister Today

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

how do you exclude something or include it?

if I wanted to know if a string had birthday in, I could choose to include it or exclude it like.

if the string contains birthday, it will do something, else do something.
0
eNarc
Asked:
eNarc
2 Solutions
 
maosalahCommented:
Use Pos function
For example : if Pos('birthday', 'string Value') > 0 then do something  else do something.

good luck
0
 
ThommyCommented:
0
 
ThommyCommented:
If you are working with multi-byte characters sets (MBCS)...

SysUtils.AnsiStrPos
http://docwiki.embarcadero.com/VCL/en/SysUtils.AnsiStrPos



0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ThommyCommented:
Using System.Pos is also possible...

System.Pos
http://docwiki.embarcadero.com/VCL/en/System.Pos
0
 
Ephraim WangoyaCommented:

Depends on what you are searching for, of you mean the actual birthday eg 01/01/1965, then you have to do pattern matching.

In that case, use a regular expression TRegRex or TPerlRegEx

TPerlRegEx is shipped with Delphi2010
If you are working in Delphi 7 you can download it from the net
Refer to this site for more info

http://www.regular-expressions.info/delphi.html
0
 
mlmccCommented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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