From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5e9097cf4f3eaf57 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.232.169 with SMTP id tp9mr8357270pbc.6.1333430142370; Mon, 02 Apr 2012 22:15:42 -0700 (PDT) Path: r9ni12559pbh.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.newsland.it!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Checking to see if a string is a letter Date: Mon, 02 Apr 2012 22:15:27 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <2030859.0.1333426683573.JavaMail.geo-discussion-forums@pbbnv8> NNTP-Posting-Host: e2675bd07c5f29cc671f7759e9913576 Mime-Version: 1.0 X-Trace: 02825995cb2019b24f51dca1431b3f35 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120310 Thunderbird/11.0 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=02825995cb2019b24f51dca1431b3f35 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-04-02T22:15:27-07:00 List-Id: On 04/02/2012 09:52 PM, deuteros wrote: > Leo Brewin wrote in > news:2030859.0.1333426683573.JavaMail.geo-discussion-forums@pbbnv8: > >> On Tuesday, 3 April 2012 12:11:56 UTC+10, deuteros wrote: >> >>> Is there a way to check if a string variable contains a single letter? >> >> Yes. > > So how would one do that? In Java I would use regular expressions, and GNAT > seems to have a library for regular expressions, but I'm looking for > something a little more portable. What do you mean by "contains a single letter"? For example, given S1 : String := "12345j%^&*("; S2 : String := "A"; you have 2 String variables, both of which contain a single letter. S1 contains other characters as well, while S2 contains only a single letter. It will probably also help to explain the problem that gives rise to this sub-problem, as context is always helpful in knowing how to answer. -- Jeff Carter "It is the German who is so uncourteous to his verbs." A Scandal in Bohemia 122