Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 29 Jun 2011 17:52:47 -0500 Date: Wed, 29 Jun 2011 15:52:46 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: StringBuilder Difficulties References: <9v7n071ns1n0plisods3m2pi6q68rtket5@4ax.com> In-Reply-To: <9v7n071ns1n0plisods3m2pi6q68rtket5@4ax.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 18 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.196.78 X-Trace: sv3-6y2nIkbYsMWGqhxMECpXDLnqAwuQQzgftJE2/+HU3K6PzMbXJ827cDnZX3WHq7TbeQnBPwNRMqb0bnS!wC7z3yAx1ANwU20QJRwn4iHU0oMDF9PrDIg6/uyM3F3mWPHsktLWSkNZpQ/riKB2szuhhhz3DyuZ!CJKqgYyc6guSdDviUXAhly4MyoBLW5EhBjcZ/YibiSUoYA== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2009 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5787 On 6/29/2011 3:00 PM, Gene Wirchenko wrote: ... > I find the .replace() line rather ornamental. I have even more > complex parameters so I came up with my .Set() method. I am surprised > that there is no such functionality in StringBuilder. ... Whole line replacement is relatively rare in normal use. The commonest usage pattern is to create a new StringBuilder specifically for some complex string build operation. It is modified in various ways, especially append, until the build is complete. At that point the toString result is used. It is relatively rare to decide, part way through a build, to throw away the work so far and begin again with entirely different contents. Patricia