public class StringUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
__ISO_8859_1 |
static Charset |
__ISO_8859_1_CHARSET |
static String |
__LINE_SEPARATOR |
static String |
__UTF16 |
static String |
__UTF8 |
static Charset |
__UTF8_CHARSET |
static String |
__UTF8Alt |
static String |
ALL_INTERFACES |
static String |
CRLF |
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
append(StringBuilder buf,
byte b,
int base)
append hex digit
|
static void |
append(StringBuilder buf,
String s,
int offset,
int length)
Append substring to StringBuilder
|
static void |
append2digits(StringBuffer buf,
int i) |
static void |
append2digits(StringBuilder buf,
int i) |
static String |
asciiToLowerCase(String s)
fast lower case conversion.
|
static boolean |
endsWithIgnoreCase(String s,
String w) |
static boolean |
equals(String s,
char[] buf,
int offset,
int length) |
static byte[] |
getBytes(String s) |
static byte[] |
getBytes(String s,
String charset) |
static int |
indexFrom(String s,
String chars)
returns the next index of a character from the chars string
|
static boolean |
isUTF8(String charset) |
static String |
nonNull(String s)
Return a non null string.
|
static String |
printable(byte[] b) |
static String |
printable(String name) |
static String |
replace(String s,
String sub,
String with)
replace substrings within string.
|
static String |
sidBytesToString(byte[] sidBytes)
Converts a binary SID to a string SID
http://en.wikipedia.org/wiki/Security_Identifier
S-1-IdentifierAuthority-SubAuthority1-SubAuthority2-...-SubAuthorityn
|
static byte[] |
sidStringToBytes(String sidString)
Converts a string SID to a binary SID
http://en.wikipedia.org/wiki/Security_Identifier
S-1-IdentifierAuthority-SubAuthority1-SubAuthority2-...-SubAuthorityn
|
static boolean |
startsWithIgnoreCase(String s,
String w) |
static String |
toString(byte[] b,
int offset,
int length,
String charset) |
static String |
toUTF8String(byte[] b,
int offset,
int length) |
static String |
unquote(String s)
Remove single or double quotes.
|
public static final String ALL_INTERFACES
public static final String CRLF
public static final String __LINE_SEPARATOR
public static final String __ISO_8859_1
public static final String __UTF8
public static final String __UTF8Alt
public static final String __UTF16
public static final Charset __UTF8_CHARSET
public static final Charset __ISO_8859_1_CHARSET
public static String asciiToLowerCase(String s)
s
- the string to convertpublic static int indexFrom(String s, String chars)
public static String replace(String s, String sub, String with)
public static void append(StringBuilder buf, String s, int offset, int length)
buf
- StringBuilder to append tos
- String to append fromoffset
- The offset of the substringlength
- The length of the substringpublic static void append(StringBuilder buf, byte b, int base)
public static void append2digits(StringBuffer buf, int i)
public static void append2digits(StringBuilder buf, int i)
public static String nonNull(String s)
s
- Stringpublic static boolean equals(String s, char[] buf, int offset, int length)
public static String toUTF8String(byte[] b, int offset, int length)
public static boolean isUTF8(String charset)
public static String printable(byte[] b)
public static byte[] getBytes(String s)
public static String sidBytesToString(byte[] sidBytes)
public static byte[] sidStringToBytes(String sidString)
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.