com.jdon.util
类 StringUtil
java.lang.Object
com.jdon.util.StringUtil
public class StringUtil
- extends Object
- 版本:
- $Revision: 1.2 $
- 作者:
- Brian Chan
|
方法摘要 |
static boolean |
contains(String s,
String text,
String delimiter)
|
static int |
count(String s,
String text)
|
static String |
decodeString(String str)
Decode a string using Base64 encoding. |
static String |
encodePassword(String password,
String algorithm)
Encode a string using algorithm specified in web.xml and return the
resulting encrypted password. |
static String |
encodeString(String str)
Encode a string using Base64 encoding. |
static String |
getPassword(int length)
|
static String |
getPassword(int length,
String key)
|
static String |
merge(String[] array,
String delimiter)
|
static String |
read(ClassLoader classLoader,
String name)
|
static String |
read(InputStream is)
|
static String |
remove(String s,
String remove,
String delimiter)
|
static String |
replace(String s,
String[] oldSubs,
String[] newSubs)
|
static String |
replace(String s,
String oldSub,
String newSub)
|
static String |
reverse(String s)
|
static String |
shorten(String s)
|
static String |
shorten(String s,
int length)
|
static String |
shorten(String s,
int length,
String suffix)
|
static String |
shorten(String s,
String suffix)
|
static String[] |
split(String s,
String delimiter)
|
static boolean[] |
split(String s,
String delimiter,
boolean x)
|
static double[] |
split(String s,
String delimiter,
double x)
|
static float[] |
split(String s,
String delimiter,
float x)
|
static int[] |
split(String s,
String delimiter,
int x)
|
static long[] |
split(String s,
String delimiter,
long x)
|
static short[] |
split(String s,
String delimiter,
short x)
|
static String |
stackTrace(Throwable t)
|
static boolean |
startsWith(String s,
char begin)
|
static boolean |
startsWith(String s,
String begin)
|
static String |
wrap(String text)
|
static String |
wrap(String text,
int width)
|
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtil
public StringUtil()
contains
public static boolean contains(String s,
String text,
String delimiter)
count
public static int count(String s,
String text)
merge
public static String merge(String[] array,
String delimiter)
read
public static String read(ClassLoader classLoader,
String name)
throws IOException
- 抛出:
IOException
read
public static String read(InputStream is)
throws IOException
- 抛出:
IOException
remove
public static String remove(String s,
String remove,
String delimiter)
replace
public static String replace(String s,
String oldSub,
String newSub)
replace
public static String replace(String s,
String[] oldSubs,
String[] newSubs)
reverse
public static String reverse(String s)
shorten
public static String shorten(String s)
shorten
public static String shorten(String s,
int length)
shorten
public static String shorten(String s,
String suffix)
shorten
public static String shorten(String s,
int length,
String suffix)
split
public static String[] split(String s,
String delimiter)
split
public static boolean[] split(String s,
String delimiter,
boolean x)
split
public static double[] split(String s,
String delimiter,
double x)
split
public static float[] split(String s,
String delimiter,
float x)
split
public static int[] split(String s,
String delimiter,
int x)
split
public static long[] split(String s,
String delimiter,
long x)
split
public static short[] split(String s,
String delimiter,
short x)
stackTrace
public static final String stackTrace(Throwable t)
startsWith
public static boolean startsWith(String s,
char begin)
startsWith
public static boolean startsWith(String s,
String begin)
wrap
public static String wrap(String text)
wrap
public static String wrap(String text,
int width)
getPassword
public static String getPassword(int length,
String key)
getPassword
public static String getPassword(int length)
encodePassword
public static String encodePassword(String password,
String algorithm)
- Encode a string using algorithm specified in web.xml and return the
resulting encrypted password. If exception, the plain credentials string
is returned
- 参数:
password - Password or other credentials to use in authenticating this
usernamealgorithm - Algorithm used to do the digest
- 返回:
- encypted password based on the algorithm.
encodeString
public static String encodeString(String str)
- Encode a string using Base64 encoding. Used when storing passwords as
cookies.
This is weak encoding in that anyone can use the decodeString routine to
reverse the encoding.
- 参数:
str -
- 返回:
- String
decodeString
public static String decodeString(String str)
- Decode a string using Base64 encoding.
- 参数:
str -
- 返回:
- String
Copyright © 2013. All Rights Reserved.