From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Ok - WHAT are those "Maps.Identity" things ??? Date: Wed, 5 Jan 2022 14:01:00 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 5 Jan 2022 13:01:00 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="72c8f5af9551dff889df858b220ff646"; logging-data="18632"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pZcP0z2NBDnJ+i/9S6FDunAXbxIfkRVg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cancel-Lock: sha1:RZB0MG+obHBcCdVIokRvnhNXSms= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63342 List-Id: On 2022-01-05 01:54, 1.AAC0831 wrote: > > The docs say to use Index(source,substr,,) I don't know what "docs" you mean. Anyone using Ada should be familiar with its standard library, which is documented in Annex A of the ARM at http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-A.html (I provide the link to the AARM as the annotations are sometimes useful.) The documentation for Ada.Strings.Fixed is at http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-A-4-3.html and lists 6 functions named Index (and 2 for Index_Non_Blank). Of these I mostly use the one at paragraph 9: 9 function Index (Source : in String; Pattern : in String; Going : in Direction := Forward; Mapping : in Maps.Character_Mapping := Maps.Identity) return Natural; with the defaults for the last 2 parameters. Occasionally I've used a Going => Backward, The Mapping/Test parameters are for specialized needs, such as case-insensitive matching or folding accented characters together, and the default will work if you don't need anything like that. -- Jeff Carter "When and now is this guitar piece from Stottlemeyer? Yes, it's with Mr. Dog in Gertrude's pinball forest." The World's Funniest Joke 133