Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: simple StringBuilder proposal Date: Thu, 28 Feb 2013 05:14:46 +0100 Lines: 17 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de aZFVV59owBtW+UYPYJXPfAqjFKQKrfnxgeHQUZqDRtStLGxxHC5EVfYS1jmhegXaz2eYzdyFwd Cancel-Lock: sha1:CGJFjeHJPr6YDBaI4agkLO62Xrs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130223 Thunderbird/17.0.3 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:22607 Am 27.02.2013 19:31, schrieb Roedy Green: > On Tue, 26 Feb 2013 10:33:25 -0800 (PST), Lew > wrote, quoted or indirectly quoted someone who said : > >> Java already has a shorthand for that: >> >> String s = "> + cseAccount + ":" + cseCode + "\">\n"; > > The difference is you cannot give a size estimate when you use +. And you dont have to, because the stringbuilder implements exponential groth. In result, the amount of characters copied during array expansion is linear in the final length of the stringbuilder. Regards, Sven