Package com.pi4j.util
Class StringUtil
- java.lang.Object
-
- com.pi4j.util.StringUtil
-
public class StringUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static char
DEFAULT_PAD_CHAR
static String
EMPTY
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
byteArrayToHex(byte[] data)
static String
byteArrayToHex(byte[] data, CharSequence delimiter)
static String
byteArrayToHex(byte[] data, CharSequence delimiter, CharSequence prefix)
static String
center(String text, int length)
static String
concat(String... data)
static boolean
contains(String[] sources, String target)
static boolean
contains(String[] sources, String[] targets)
static boolean
contains(String source, String target)
static boolean
contains(String source, String[] targets)
static String
create(char c, int length)
static String
create(int length)
static String
create(String s, int length)
static boolean
isNotNullOrEmpty(String data)
static boolean
isNotNullOrEmpty(String data, boolean trim)
static boolean
isNullOrEmpty(String data)
static boolean
isNullOrEmpty(String data, boolean trim)
static String
pad(String data, char pad, int length)
static String
pad(String data, int length)
static String
pad(String data, String pad, int length)
static String
padCenter(String data, char pad, int length)
static String
padCenter(String data, int length)
static String
padLeft(String data, char pad, int length)
static String
padLeft(String data, int length)
static String
padLeft(String data, String pad, int length)
static String
padRight(String data, char pad, int length)
static String
padRight(String data, int length)
static String
padRight(String data, String pad, int length)
static String
repeat(char c, int length)
static String
trim(String data)
static String
trim(String data, char trim)
static String
trimLeft(String data)
static String
trimLeft(String data, char trim)
static String
trimRight(String data)
static String
trimRight(String data, char trim)
-
-
-
Field Detail
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
DEFAULT_PAD_CHAR
public static final char DEFAULT_PAD_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isNullOrEmpty
public static boolean isNullOrEmpty(String data, boolean trim)
-
isNullOrEmpty
public static boolean isNullOrEmpty(String data)
-
isNotNullOrEmpty
public static boolean isNotNullOrEmpty(String data)
-
isNotNullOrEmpty
public static boolean isNotNullOrEmpty(String data, boolean trim)
-
create
public static String create(int length)
-
create
public static String create(char c, int length)
-
repeat
public static String repeat(char c, int length)
-
byteArrayToHex
public static String byteArrayToHex(byte[] data)
-
byteArrayToHex
public static String byteArrayToHex(byte[] data, CharSequence delimiter)
-
byteArrayToHex
public static String byteArrayToHex(byte[] data, CharSequence delimiter, CharSequence prefix)
-
-