public class StringUtil extends Object
| Constructor and Description |
|---|
StringUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addHeader(StringBuilder sb,
String key,
String value)
Adds the header.
|
static StringBuilder |
addParam(StringBuilder sb,
String key,
String param)
Adds the param.
|
static StringBuilder |
addQuotedParam(StringBuilder sb,
String key,
String param)
Adds the quoted param.
|
static String |
join(String delim,
Collection<String> collections)
Join.
|
static String |
join(String delim,
int start,
int end,
String... strings)
Join.
|
static String |
join(String delim,
String... strings)
Join.
|
static String |
lpad(Object str,
int len,
String padding)
Lpad.
|
static Map<String,String> |
parseKeyValues(String str,
char delim)
ex.
|
static String |
readLine(ByteBuffer buf)
Read line.
|
static String |
rpad(Object str,
int len,
String padding)
Rpad.
|
static String |
toHexString(byte b)
toHexString.
|
static String |
toHexString(byte[] bytes)
toHexString.
|
static String |
toMD5HexString(String str)
To m d5 hex string.
|
public static String join(String delim, Collection<String> collections)
delim - the delimcollections - the collectionspublic static String join(String delim, String... strings)
delim - the delimstrings - the stringspublic static String join(String delim, int start, int end, String... strings)
delim - the delimstart - the startend - the endstrings - the stringspublic static void addHeader(StringBuilder sb, String key, String value)
sb - the sbkey - the keyvalue - the valuepublic static String readLine(ByteBuffer buf)
buf - the bufpublic static StringBuilder addParam(StringBuilder sb, String key, String param)
sb - the sbkey - the keyparam - the parampublic static StringBuilder addQuotedParam(StringBuilder sb, String key, String param)
sb - the sbkey - the keyparam - the parampublic static String toMD5HexString(String str)
str - the strpublic static String toHexString(byte b)
b - the bpublic static String toHexString(byte[] bytes)
bytes - the bytespublic static String lpad(Object str, int len, String padding)
str - the strlen - the lenpadding - the paddingpublic static String rpad(Object str, int len, String padding)
str - the strlen - the lenpadding - the paddingCopyright © 2021. All rights reserved.