|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.util.StringUtil
public class StringUtil
Utility class useful when dealing with string objects. This class is a collection of static functions, and the usage is: StringUtil.method() it is not allowed to create instances of this class
Method Summary | |
---|---|
static boolean |
endsWithIgnoreCase(java.lang.String str,
java.lang.String suffix)
This method check if a string ends with the specified suffix ignoring the case. |
static boolean |
equalsIgnoreCase(java.lang.String string1,
java.lang.String string2)
This method is missing in CLDC 1.0 String implementation |
static java.lang.String |
extractAddressFromUrl(java.lang.String url)
This method extracts from address the resources |
static java.lang.String |
extractAddressFromUrl(java.lang.String url,
java.lang.String protocol)
This method extracts from address the protocol port and resources |
static int |
findEmptyLine(java.lang.String s)
Find two consecutive newlines in a string. |
static java.lang.String |
fold(java.lang.String recipients)
Builds a list of the recipients email addresses each on a different line, starting just from the second line with an HT ("\t") separator at the head of the line. |
static boolean |
getBooleanValue(java.lang.String string)
Util method for retrieve a boolean primitive type from a String. |
static java.lang.String |
getProtocolFromUrl(java.lang.String url)
This method retrieves the protocol used in the given url. |
static java.lang.String[] |
getStringArray(java.util.Vector stringVec)
Returns the string array |
static java.util.Vector |
getVectorFromArray(java.lang.Object[] array)
create a vector filled with the elements of the given array |
static boolean |
isNullOrEmpty(java.lang.String str)
Returns true if the given string is null or empty. |
static boolean |
isValidProtocol(java.lang.String url)
This method check if the protocol used in the given url is valid. |
static java.lang.String |
join(java.lang.String[] list,
java.lang.String sep)
Join the given strings into a single string using sep as separator for individual values. |
static java.lang.String |
removeBackslashes(java.lang.String content)
Removes unwanted backslashes characters |
static java.lang.String |
removeBlanks(java.lang.String content)
Removes unwanted blank characters |
static java.lang.String |
removeChar(java.lang.String content,
char ch)
Removes unwanted characters |
static java.lang.String |
removePortFromUrl(java.lang.String url,
java.lang.String protocol)
|
static java.lang.String |
replaceAll(java.lang.String s,
char c1,
char c2)
Replace all characters c1 with c2 |
static java.lang.String |
replaceAll(java.lang.String s,
java.lang.String src,
java.lang.String tgt)
Replace any occurrence of one string with another one |
static java.lang.String[] |
split(java.lang.String s,
java.lang.String sep)
Split the string into an array of strings using one of the separator in 'sep'. |
static java.lang.String[] |
split(java.lang.String s,
java.lang.String[] sepArray)
Split the string into an array of strings using one of the separator in 'sep'. |
static java.lang.String |
trim(java.lang.String s,
char c)
Removes characters 'c' from the beginning and the end of the string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String[] split(java.lang.String s, java.lang.String sep)
s
- the string to tokenizesep
- a list of separator to use
public static java.lang.String[] split(java.lang.String s, java.lang.String[] sepArray)
s
- the string to tokenizesep
- a list of separators (strings, not chars) to use
public static java.lang.String join(java.lang.String[] list, java.lang.String sep)
list
- the string array to joinsep
- the separator to use
public static java.lang.String[] getStringArray(java.util.Vector stringVec)
stringVec
- the Vecrot of tring to convert
public static java.util.Vector getVectorFromArray(java.lang.Object[] array)
array
-
public static int findEmptyLine(java.lang.String s)
s
- - The string to search
public static java.lang.String removeBlanks(java.lang.String content)
content
-
public static java.lang.String removeBackslashes(java.lang.String content)
content
- The string containing the backslashes to be removed
public static java.lang.String removeChar(java.lang.String content, char ch)
content
- The string containing the backslashes to be removedch
- the character to be removed
public static java.lang.String fold(java.lang.String recipients)
recipients
- A string containing all recipients comma-separated
public static boolean equalsIgnoreCase(java.lang.String string1, java.lang.String string2)
public static boolean getBooleanValue(java.lang.String string)
public static java.lang.String trim(java.lang.String s, char c)
public static boolean isNullOrEmpty(java.lang.String str)
public static java.lang.String extractAddressFromUrl(java.lang.String url, java.lang.String protocol)
url
- eg. http://127.0.0.1:8080/syncprotocol
- http
public static java.lang.String extractAddressFromUrl(java.lang.String url)
url
- eg. http://127.0.0.1:8080/sync
public static java.lang.String removePortFromUrl(java.lang.String url, java.lang.String protocol)
public static java.lang.String getProtocolFromUrl(java.lang.String url)
url
- eg. http://127.0.0.1:8080/sync
public static boolean isValidProtocol(java.lang.String url)
url
- eg. http://127.0.0.1:8080/sync
public static boolean endsWithIgnoreCase(java.lang.String str, java.lang.String suffix)
str
- - string to check
suffix - the suffix to find
public static java.lang.String replaceAll(java.lang.String s, char c1, char c2)
s
- the String to be manipulatedc1
- the char to be replacedc2
- the char to put in place of c1
public static java.lang.String replaceAll(java.lang.String s, java.lang.String src, java.lang.String tgt)
s
- the String to be manipulatedsrc
- the string to be replacedtgt
- the replacement string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |