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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,decb0c44a2cbd5dc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-01 09:53:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!opentransit.net!wanadoo.fr!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: Re: How to delete charcters in a string? Date: 01 Feb 2002 18:53:44 +0100 Organization: Home - http://perso.wanadoo.fr/pascal.obry Message-ID: References: <4519e058.0201310647.3637d7a9@posting.google.com> NNTP-Posting-Host: avelizy-103-1-5-197.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: wanadoo.fr 1012586026 24380 80.13.115.197 (1 Feb 2002 17:53:46 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 1 Feb 2002 17:53:46 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.80 Xref: archiver1.google.com comp.lang.ada:19496 Date: 2002-02-01T17:53:46+00:00 List-Id: Stephen Leake writes: > tmoran@acm.org writes: > > > >the techniques you may have learned for dealing with dynamic C > > >strings are liable to be completely inappropriate for dealing with > > >fixed Ada strings. > > > How would you delete a character from a C string? Seems to me that's > > probably harder that with an Ada string (lack of slice assignment), > > char *S1 = "ABCDEF"; > > strncpy (S1 + 3, S1 + 4, 3); > > result in *S1 is "ABDEF". > > No where near as pretty or readable as Ada, but just as short and > easy. And I've probably got the "src" and "dest" parameters swapped. > Man, I hate C :). And that is not what you wanted too :) result in *S1 is "ABDEFF". Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://perso.wanadoo.fr/pascal.obry --| --| "The best way to travel is by means of imagination"