|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectezvcard.util.VCardStringUtils
public class VCardStringUtils
Helper class for dealing with vCard strings.
| Method Summary | |
|---|---|
static boolean |
containsNewlines(String text)
Determines if a string contains one or more newline characters. |
static String |
escape(String text)
Escapes all special characters within a vCard value. |
static String |
escapeNewlines(String text)
Escapes all newline characters within a vCard value. |
static String |
ltrim(String string)
Trims the whitespace off the left side of a string. |
static String |
rtrim(String string)
Trims the whitespace off the right side of a string. |
static String[] |
splitBy(String str,
char ch,
boolean removeEmpties,
boolean unescape)
Splits a string by a character, taking escaped characters into account. |
static String |
unescape(String text)
Unescapes all special characters that are escaped with a backslash, as well as escaped newlines. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String unescape(String text)
text - the text
public static String escape(String text)
These characters are:
\),);)
text - the text to escape
public static String escapeNewlines(String text)
This method escapes the following newline sequences:
\r\n\r\n
text - the text to escape
public static boolean containsNewlines(String text)
text - the string
public static String[] splitBy(String str,
char ch,
boolean removeEmpties,
boolean unescape)
For example:
splitBy("HE\:LLO::WORLD", ':', false, true)
returns
["HE:LLO", "", "WORLD"]
str - the string to splitch - the character to split byremoveEmpties - true to remove empty elements, false not tounescape - true to unescape each split string, false not to
public static String ltrim(String string)
string - the string to trim
public static String rtrim(String string)
string - the string to trim
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||