Class CaseUtils
- java.lang.Object
 - 
- org.apache.commons.text.CaseUtils
 
 
- 
public class CaseUtils extends java.lang.ObjectCase manipulation operations on Strings that contain words.
This class tries to handle
nullinput gracefully. An exception will not be thrown for anullinput. Each method documents its behavior in more detail.- Since:
 - 1.2
 
 
- 
- 
Constructor Summary
Constructors Constructor Description CaseUtils()CaseUtilsinstances should NOT be constructed in standard programming. 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringtoCamelCase(java.lang.String str, boolean capitalizeFirstLetter, char... delimiters)Converts all the delimiter separated words in a String into camelCase, that is each word is made up of a title case character and then a series of lowercase characters. 
 - 
 
- 
- 
Constructor Detail
- 
CaseUtils
public CaseUtils()
CaseUtilsinstances should NOT be constructed in standard programming. Instead, the class should be used asCaseUtils.toCamelCase("foo bar", true, new char[]{'-'});.This constructor is public to permit tools that require a JavaBean instance to operate.
 
 - 
 
- 
Method Detail
- 
toCamelCase
public static java.lang.String toCamelCase(java.lang.String str, boolean capitalizeFirstLetter, char... delimiters)Converts all the delimiter separated words in a String into camelCase, that is each word is made up of a title case character and then a series of lowercase characters.
The delimiters represent a set of characters understood to separate words. The first non-delimiter character after a delimiter will be capitalized. The first String character may or may not be capitalized and it's determined by the user input for capitalizeFirstLetter variable.
A
nullinput String returnsnull. Capitalization uses the Unicode title case, normally equivalent to upper case and cannot perform locale-sensitive mappings.CaseUtils.toCamelCase(null, false) = null CaseUtils.toCamelCase("", false, *) = "" CaseUtils.toCamelCase(*, false, null) = * CaseUtils.toCamelCase(*, true, new char[0]) = * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) = "toCamelCase" CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'}) = "ToCamelCase" CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) = "toCamelCase"- Parameters:
 str- the String to be converted to camelCase, may be nullcapitalizeFirstLetter- boolean that determines if the first character of first word should be title case.delimiters- set of characters to determine capitalization, null and/or empty array means whitespace- Returns:
 - camelCase of String, 
nullif null String input 
 
 - 
 
 -