com.sun.appserv.management.util.misc
Class StringUtil
java.lang.Object
com.sun.appserv.management.util.misc.StringUtil
public final class StringUtil
- extends Object
Escapes/unescapes strings
Method Summary |
static String |
findAndStripPrefix(Set<String> prefixes,
String s)
|
static String |
getPrefix(Set<String> prefixes,
String s)
|
static String |
NEWLINE()
|
static String |
quote(Object o)
|
static String |
quote(Object o,
char leftHandChar)
|
static String |
replaceSuffix(String s,
String fromSuffix,
String toSuffix)
|
static String |
stripPrefix(String s,
String prefix)
|
static String |
stripPrefixAndSuffix(String s,
String prefix,
String suffix)
|
static String |
stripSuffix(String s,
String suffix)
|
static String |
toHexString(byte theByte)
|
static String |
toHexString(byte[] bytes)
|
static String |
toHexString(byte[] bytes,
String delim)
|
static String |
toString(String[] args)
|
static String |
toString(String delim,
Object... args)
Turn an array (or varargs) set of Objects into a String
using the specified delimiter. |
static String |
toString(String delim,
String... args)
|
static String |
upperCaseFirstLetter(String s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QUOTE_CHAR
public static final char QUOTE_CHAR
- See Also:
- Constant Field Values
QUOTE
public static final String QUOTE
- See Also:
- Constant Field Values
LS
public static final String LS
- Line separator as returned by System.getProperty()
quote
public static String quote(Object o)
quote
public static String quote(Object o,
char leftHandChar)
toHexString
public static String toHexString(byte theByte)
toHexString
public static String toHexString(byte[] bytes)
toHexString
public static String toHexString(byte[] bytes,
String delim)
stripSuffix
public static String stripSuffix(String s,
String suffix)
replaceSuffix
public static String replaceSuffix(String s,
String fromSuffix,
String toSuffix)
stripPrefix
public static String stripPrefix(String s,
String prefix)
stripPrefixAndSuffix
public static String stripPrefixAndSuffix(String s,
String prefix,
String suffix)
upperCaseFirstLetter
public static String upperCaseFirstLetter(String s)
toString
public static String toString(String[] args)
toString
public static String toString(String delim,
String... args)
toString
public static String toString(String delim,
Object... args)
- Turn an array (or varargs) set of Objects into a String
using the specified delimiter.
getPrefix
public static String getPrefix(Set<String> prefixes,
String s)
- Returns:
- the prefix found, or null if not found
findAndStripPrefix
public static String findAndStripPrefix(Set<String> prefixes,
String s)
- Returns:
- the String after stripping the prefix
- Throws:
IllegalArgumentException
- if no prefix found
NEWLINE
public static String NEWLINE()
Submit a bug or feature Copyright 2006 Sun Microsystems, Inc. All rights reserved.