Class Strings
org.elasticsearch.common.inject.internal.Strings
public class Strings
extends
String utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic
s)
Returns a string that is equivalent to the specified string with its first character converted to uppercase as by .Methods inherited from class java.lang.
, , , , , , , , , ,
-
Method Details
-
capitalize
public static capitalize( s)Returns a string that is equivalent to the specified string with its first character converted to uppercase as by . The returned string will have the same value as the specified string if its first character is non-alphabetic, if its first character is already uppercase, or if the specified string is of length 0.For example:
capitalize("foo bar").equals("Foo bar"); capitalize("2b or not 2b").equals("2b or not 2b") capitalize("Foo bar").equals("Foo bar"); capitalize("").equals("");
- Parameters:
s
- the string whose first character is to be uppercased- Returns:
- a string equivalent to
s
with its first character converted to uppercase - Throws:
- if
s
is null
-