Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.programmer Subject: Re: Inserting In a List Date: Wed, 03 Apr 2013 10:35:22 +0100 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <6757cccc-794e-4dd1-8d73-9cb617b75572@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx05.eternal-september.org; posting-host="7e194865abb1454ff7685570b1bd8709"; logging-data="30815"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/24iFSOlpnAu/RYfZpdqPKPSQ5hjkFMA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 In-Reply-To: <6757cccc-794e-4dd1-8d73-9cb617b75572@googlegroups.com> Cancel-Lock: sha1:isEmScB2C3CDihqoSwV0+t/6c2w= Xref: csiph.com comp.lang.java.programmer:23215 On 03/04/13 09:47, subhabangalore@gmail.com wrote: > It worked. What worked? I counted a dozen or so distinct suggestions, not necessarily mutually exclusive. 1. Build the combined string with a loop. 2. Use Guava libraries. 3. Use Apache libraries. 4. list.toString() 5. Move the list creation to before the loop. 6. Arrays.toString(list.toArray()) 7. Don't bother trying to compose a string. 8. Create a fixed-size list using Arrays.asList. 9. Create a fully mutable list using new ArrayList(Arrays.asList) 10. Create a File object representing the filename you're looking for, and test directly. 11. Use FastCat. 12. Use StringBuilder. 13. Use getPath(). 14. Use getName(). -- ss at comp dot lancs dot ac dot uk