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
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
capitalize
(String str) Capitalizes all the whitespace separated words in a String.static String
capitalize
(String str, char[] delimiters) Capitalizes all the delimiter separated words in a String.static boolean
Return true if String value is null or empty.static final String
Replace 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)
. Anull
input 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,
null
if 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
null
input 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,
null
if null String input - Since:
- 2.1
-