On Wednesday, August 22, 2001, at 10:23 PM, Daniel Rall wrote:

> This implementation of removeUnderScores does *way* too much.  In
> addition to doing what its name indicates, it also changes the case of
> the name parts.  It looks like this was once used in Torque (but no
> longer).  I'd like to bring this implementation in line with the name,
> unless anyone has a reason why I shouldn't.  I would make it look just
> like the Commons Util version of the same name.
>
>     static public String removeUnderScores (String data)
>     {
>         String temp = null;
>         StringBuffer out = new StringBuffer();
>         temp = data;
>
>         StringTokenizer st = new StringTokenizer(temp, "_");
>
>         while (st.hasMoreTokens())
>         {
>             String element = (String) st.nextElement();
>             out.append ( firstLetterCaps(element));
>         }//while
>
>         return out.toString();
>     }
>

that's why there's another method called removeAndHump :)
the removeUnderScores does what it says in the javadocs but is badly named
the reason why it was left in was to preserve backwards compatibility.

(i know 'cos i wrote a patch on this issue a few months ago :)

- robert

Reply via email to