commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C. Grobmeier" <>
Subject [lang] StringUtils.interrupt
Date Fri, 03 Feb 2006 22:57:34 GMT
Hello all,

building my websites guestbook, i figured out that somebody entered a 
big string (exactly: an URL). This blew up my complete layout. HTML 
doesn't give any solution on this, you simply can't break up this stupid 
long string.

Looking at commons lang i found a lot of join/split-operations, but it 
seems that never anybody needed something of a "separate after 20 
characters with a blank"-function. Well, i am not sure if ever somebody 
REALLY needs this besides me, but you'll never know. So i decided to let 
take you a look at my method (attached).

OK, i know it's not the very best method in the world (at least it 
midnight and i was at a whiskey tasting this evening), but if somebody 
thinks it could be useful to be included in 
org.apache.commons.lang.StringUtils i will improve it and would be glad 
to contribute "interrupt()" to you. If somebody has a better idea than 
this, your comments are welcome.

Let me know.
Having said this, good night.

- Chris

View raw message