Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inverse function to StringUtils.capitalize()

There is convenient method StringUtils.capitalize() in apache-commons-lang library. But I can not find pairwise inverse method for it, which will make first letter in word in lowercase. Does such method exists?

like image 333
Denys Avatar asked Mar 31 '15 15:03

Denys


People also ask

What is the use of StringUtils in Java?

Most common use of StringUtils is in web projects (when you want to check for blank or null strings, checking if a string is number, splitting strings with some token). StringUtils helps to get rid of those nasty NumberFormat and Null exceptions. But StringUtils can be used anywhere String is used.

What does StringUtils empty return?

isEmpty() is a static method of the StringUtils class that is used to check if a given string is empty or not. If a string satisfies any of the criteria below, then the string is considered to be empty. The length of the string is zero. The string points to a null reference.


1 Answers

You're looking for StringUtils.uncapitalize:

Uncapitalizes a String changing the first letter to title case as per Character.toLowerCase(char). No other letters are changed.

like image 179
M A Avatar answered Sep 23 '22 10:09

M A