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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7bcba1db9ed24fa7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-07 20:15:42 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.bc.home.com.POSTED!not-for-mail Sender: stephen@anakin Newsgroups: comp.lang.ada Subject: Re: is ada dead? References: <3B460DA9.C2965042@ix.netcom.com> <9ff447f2.0107061757.34ca0723@posting.google.com> <9i6lak$bqi$1@geraldo.cc.utexas.edu> <3B475916.E4548A5D@worldnet.att.net> From: stephen_bevan@yahoo.com (Stephen J. Bevan) Message-ID: Organization: just me at home X-Newsreader: Gnus v5.7/Emacs 20.7 Date: Sun, 08 Jul 2001 03:15:41 GMT NNTP-Posting-Host: 24.77.89.252 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.bc.home.com 994562141 24.77.89.252 (Sat, 07 Jul 2001 20:15:41 PDT) NNTP-Posting-Date: Sat, 07 Jul 2001 20:15:41 PDT Xref: archiver1.google.com comp.lang.ada:9626 Date: 2001-07-08T03:15:41+00:00 List-Id: James Rogers writes: > In other words, if > you want to loop through all the characters in an existing 1024 > character String, replacing each one, you will require the creation > and garbage collection of 1024 1024 character strings. Since Java > characters are all 16 bits, this means that you need to chew up > over 2 Megabytes of data to edit a 1024 character String. You could do it like that. However, it would be more efficient to turn your String into a StringBuffer, which supports in-place updates. Make all the changes you want to the StringBuffer and then turn it back into a String. This way you'd only chew up approximately 3K.