public class StringTools extends Object
| Constructor and Description |
|---|
StringTools() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asHex(byte[] data) |
static String |
capitalize(String text)
Capitalize the given string (null safe)
|
static String |
formatSize(long size)
Format the given size
|
static int |
indexOf(String text,
String needle,
int fromIndex,
boolean ignoreCase)
Case-aware version of startsWith()
|
static int |
indexOfIgnoreCase(String text,
String needle,
int fromIndex)
Case-insensitive version of indexOf()
|
static boolean |
isEmpty(String text)
Test if the given text is null or an empty string
|
static boolean |
isNotEmpty(String text)
Test if the given text is not null and not an empty string
|
static String |
join(Collection<?> objects,
String separator) |
static String |
join(Object[] objects,
String separator) |
static boolean |
matches(String text,
String pattern)
Check if the given text matches a pattern
|
protected static boolean |
matches(String text,
String pattern,
boolean ignoreCase)
Check if the given text matches a pattern
|
static boolean |
matchesIgnoreCase(String text,
String pattern)
Check if the given text matches a pattern
|
static String |
rightPad(String value,
int size,
char padChar)
Right pad the given string
|
static String[] |
split(String str,
char separatorChar) |
static boolean |
startsWith(String text,
String prefix,
int offset,
boolean ignoreCase)
Case-aware version of startsWith()
|
static boolean |
startsWithIgnoreCase(String text,
String prefix,
int offset)
Case-insensitive version of startsWith()
|
public static boolean isEmpty(String text)
public static boolean isNotEmpty(String text)
public static String rightPad(String value, int size, char padChar)
public static boolean startsWith(String text, String prefix, int offset, boolean ignoreCase)
public static boolean startsWithIgnoreCase(String text, String prefix, int offset)
public static int indexOf(String text, String needle, int fromIndex, boolean ignoreCase)
public static int indexOfIgnoreCase(String text, String needle, int fromIndex)
public static boolean matches(String text, String pattern)
public static boolean matchesIgnoreCase(String text, String pattern)
protected static boolean matches(String text, String pattern, boolean ignoreCase)
public static String capitalize(String text)
text - String to capitalizepublic static String join(Collection<?> objects, String separator)
public static String formatSize(long size)
public static String asHex(byte[] data)
Copyright © 2019. All rights reserved.