<< mysql-front is alive | Home | ORA-00911: invalid character >>

StringUtils

nothing useful in commons-lang?

update: commons-lang 2.4 now includes an intelligent abbreviation method . So no need to duplicate this anymore.

It happens so often that I'm in the need for some small utility methods. Most of the time the needed code can be found in commons lang or the various spring util classes. But sometimes both don't give an answer. That is the time for my all time favourite util classes (duplicated in every project ;-)) - named FooBarUtils.

Today I was working on kinokai.de and was in desperate need for the following functionality:

  • remove all html tags from a string
  • do intelligent abbreviation of a string (do no cut in the middle of words)
See the following code snippets for my KkStringUtils - maybe you need similar functionality in one of your projects and can reuse my code. Note that the class contains some other String related functionality... And a really small unit test:




Add a comment Send a TrackBack