public final class TLcdStringUtil extends Object
Constructor and Description |
---|
TLcdStringUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
capitalizeFirstCharacter(String aString)
Returns a string containing all characters of the given string, but the first character will be uppercase.
|
static boolean |
containsIgnoreCase(String aString,
String aSubstring)
Returns whether the given string contains the given substring, ignoring the case.
|
static boolean |
endsWithIgnoreCase(String aString,
String aSuffix)
Returns whether the given string starts with the given prefix,
ignoring the case.
|
static int |
indexOfIgnoreCase(String aString,
String aSubstring)
Returns the index within the given string of the first occurrence of the
specified substring, ignoring the case.
|
static String |
replacePrefixPreserveCase(String aString,
int aPrefixLength,
String aNewPrefix)
Returns the given string, with its prefix replaced by a new prefix,
preserving the case of the prefix.
|
static String |
replaceSuffixPreserveCase(String aString,
int aSuffixLength,
String aNewSuffix)
Returns the given string, with its suffix replaced by a new suffix,
preserving the case of the suffix.
|
static boolean |
startsWithIgnoreCase(String aString,
String aPrefix)
Returns whether the given string starts with the given prefix,
ignoring the case.
|
static boolean |
startsWithIgnoreCase(String aString,
String aPrefix,
int aStringOffset)
Returns whether the given string starts with the given prefix,
beginning at a specified index, and ignoring the case.
|
static String |
toMatchingCase(String aString,
String aCaseString)
Returns the given string, changing its case to match the case of the given
case string.
|
public static boolean startsWithIgnoreCase(String aString, String aPrefix)
String.startsWith(String)
public static boolean startsWithIgnoreCase(String aString, String aPrefix, int aStringOffset)
String.startsWith(String, int)
public static boolean endsWithIgnoreCase(String aString, String aSuffix)
String.endsWith(java.lang.String)
public static boolean containsIgnoreCase(String aString, String aSubstring)
aString
- the string that potentially contains aSubstring
aSubstring
- the substring to look foraSubstring
, false otherwiseString.contains(java.lang.CharSequence)
public static int indexOfIgnoreCase(String aString, String aSubstring)
aString
- the string that potentially contains aSubstring
aSubstring
- the substring to look for-1
if there is no such occurrence.String.indexOf(String)
public static String replacePrefixPreserveCase(String aString, int aPrefixLength, String aNewPrefix)
public static String replaceSuffixPreserveCase(String aString, int aSuffixLength, String aNewSuffix)
public static String toMatchingCase(String aString, String aCaseString)
public static String capitalizeFirstCharacter(String aString)
aString
- the input string