> > chop removes the final character, no matter what it is, and glomming > > \r\n as if it were a single character > > This is akin to Ruby's chop and shouldn't be changed I think.
+1 > Bad evolution. My fault. The all-succeeding characters feature is one I've > been using a lot. Given: > > From: Fred > > I can do: > > String head = StringUtils.chomp(hdr, ": "); > String name = StringUtils.prechomp(hdr, ": "); So maybe they should be called "splitBefore" and "splitAfter"? Or "divide"? But in this usage they're revealed to be s.substring(0, s.lastIndexOf(sep)) and s.substring(s.lastIndexOf(sep)) so maybe we're just talking substringBefore(str, sep) and substringAfter(str, sep) ??? > I use prechomp/chomp tons :) I'm not adverse to a different names though, > as I said, they've evolved a fair bit and I ought to have renamed them > before they ended up in Lang. http://thesaurus.reference.com/search?q=chop Entry: chop Synonyms: axe, cleave, clip, cube, dice, divide, fell, fragment, hack, hackle, hash, hew, lop, mangle, mince, sever, shear, slash, truncate, whack :-) -- Alex Chaffee mailto:[EMAIL PROTECTED] Purple Technology - Code and Consulting http://www.purpletech.com/ jGuru - Java News and FAQs http://www.jguru.com/alex/ Gamelan - the Original Java site http://www.gamelan.com/ Stinky - Art and Angst http://www.stinky.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
