Article View: borland.public.delphi.language.objectpascal
Article #32520Re: How to check if a string value contains a numeric character
From: Jens Geyer
Date: Fri, 22 Nov 2002 09:06
Date: Fri, 22 Nov 2002 09:06
21 lines
1485 bytes
1485 bytes
> Given a string with five characters, how can I determine through code as to > whether or not the string contains all numeric characters? Thank you ahead > of time. > Ok, let me do your homework. function ReturnTrueIfOnlyNumbers( const aStr : string) : boolean; const NUMERIC_CHARS = '0123456789'; var i : integer; begin result := FALSE; for i := 1 to length(aStr) do if Pos( aStr[i], NUMERIC_CHARS) = 0 then Exit; result := TRUE; end. Payable within 14 days net cash. JensG
Technical Details
Message-ID:
<3dddf0e7@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailReferences:
<3ddddf95$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d30,309aca370994f001,start X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2002-11-22 01:16:43 PST From: "Jens Geyer" <jgx@vsx.net> Newsgroups: borland.public.delphi.language.objectpascal References: <3ddddf95$1@newsgroups.borland.com> Subject: Re: How to check if a string value contains a numeric character Date: Fri, 22 Nov 2002 10:06:10 +0100 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 217.80.143.212 Message-ID: <3dddf0e7@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1037955303 217.80.143.212 (22 Nov 2002 00:55:03 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail