Entries in Java (1)

Camel Case

Recently I had to convert delimited String tokens into CamelCase Strings in Java. The input was something like "foo-bar" and the output should be "FooBar". A little googling found the TreeBind library, which does exactly that. An example of the API usage looks like this:

Util.ToUpperCamelCase("foo-bar");   // returns "FooBar"
Util.ToFirstUpper("foobar")         // returns "Foobar"

Not rocket science, but it did save me some string manipulation. BTW, I don't even know what the TreeBind API does in general.

Posted on Saturday, March 15, 2008 at 06:31PM by Registered Commenter0x6e6562 in | CommentsPost a Comment