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-01-29 23:49:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!newsfeed.dacom.co.kr!intgwlon.nntp.telstra.net!news.telstra.net!news-server.bigpond.net.au!not-for-mail From: Dale Stanbrough Newsgroups: comp.lang.ada Subject: Re: How to delete charcters in a string? Organization: RMIT References: <6xM58.40153$uf7.3774162071@newssvr21.news.prodigy.com> User-Agent: MT-NewsWatcher/3.1 (PPC) Message-ID: Date: Wed, 30 Jan 2002 07:49:46 GMT NNTP-Posting-Host: 144.132.91.90 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 1012376986 144.132.91.90 (Wed, 30 Jan 2002 18:49:46 EST) NNTP-Posting-Date: Wed, 30 Jan 2002 18:49:46 EST Xref: archiver1.google.com comp.lang.ada:19379 Date: 2002-01-30T07:49:46+00:00 List-Id: tmoran@acm.org wrote: > > You can't however do... > > > > Old_String := Old_String (1..4) & Old_String (5..Last); > but of course you can do > Old_String(1 .. Last) := Old_String (1..4) & Old_String (5..Last); > > or, if Old_String(Bad_Char_Index) = offensive_character, > Old_String(Bad_Char_Index .. Last-1) := Old_String(Bad_Char_Index+1 .. > Last); > Last := Last-1; Yes you can do that, but then you are -not- deleting characters from a string, you are deleting characters from a variable length string abstraction which is contained in two variables (Old_String, Last). This is essentially what Ada.Strings.Bounded does of course. Dale