Package org.eclipse.e4.ui.css.core.utils
Class StringUtils
java.lang.Object
org.eclipse.e4.ui.css.core.utils.StringUtils
Helper for String.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String str) Capitalizes all the whitespace separated words in a String.static Stringcapitalize(String str, char[] delimiters) Capitalizes all the delimiter separated words in a String.static booleanReturn true if String value is null or empty.static final StringReplace oldString occurrences with newString occurrences of the String line and return the result.
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
replace
Replace oldString occurrences with newString occurrences of the String line and return the result. -
isEmpty
Return true if String value is null or empty. -
capitalize
Capitalizes all the whitespace separated words in a String. Only the first letter of each word is changed.
Whitespace is defined by
Character.isWhitespace(char). Anullinput String returnsnull. Capitalization uses the unicode title case, normally equivalent to upper case.WordUtils.capitalize(null) = null WordUtils.capitalize("") = "" WordUtils.capitalize("i am FINE") = "I Am FINE"- Parameters:
str- the String to capitalize, may be null- Returns:
- capitalized String,
nullif null String input
-
capitalize
Capitalizes all the delimiter separated words in a String. Only the first letter of each word is changed.
The delimiters represent a set of characters understood to separate words. The first string character and the first non-delimiter character after a delimiter will be capitalized.
A
nullinput String returnsnull. Capitalization uses the unicode title case, normally equivalent to upper case.WordUtils.capitalize(null, *) = null WordUtils.capitalize("", *) = "" WordUtils.capitalize(*, new char[0]) = * WordUtils.capitalize("i am fine", null) = "I Am Fine" WordUtils.capitalize("i aM.fine", {'.'}) = "I aM.Fine"- Parameters:
str- the String to capitalize, may be nulldelimiters- set of characters to determine capitalization, null means whitespace- Returns:
- capitalized String,
nullif null String input - Since:
- 2.1
-