| java.lang.Object org.h2.util.StringUtils
StringUtils | public class StringUtils (Code) | | A few String utility functions.
|
Method Summary | |
public static String | addAsterisk(String s, int index) | public static String | arrayCombine(String[] list, char separatorChar) | public static String[] | arraySplit(String s, char separatorChar, boolean trim) | public static String | enclose(String s) | public static boolean | equals(String a, String b) | public static String | formatDateTime(Date date, String format, String locale, String timezone) | public static String | getDefaultCharset() | public static String | indent(String s) Indents a string with 4 spaces. | public static String | indent(String s, int spaces) Indents a string with spaces. | public static boolean | isNullOrEmpty(String s) Check if a String is null or empty (the length is null). | public static String | javaDecode(String s) | public static String | javaEncode(String s) | public static String | pad(String string, int n, String padding, boolean right) Pad a string. | public static Date | parseDateTime(String date, String format, String locale, String timezone) | public static String | quoteIdentifier(String s) | public static String | quoteJavaIntArray(int[] array) | public static String | quoteJavaString(String s) | public static String | quoteJavaStringArray(String[] array) | public static String | quoteRemarkSQL(String sql) | public static String | quoteStringSQL(String s) | public static String | replaceAll(String s, String before, String after) | public static String | toLowerEnglish(String s) | public static String | toUpperEnglish(String s) | public static String | unEnclose(String s) | public static String | urlDecode(String encoded) | public static String | urlEncode(String s) | public static String | utf8Decode(byte[] utf8) | public static String | utf8Decode(byte[] bytes, int offset, int length) | public static byte[] | utf8Encode(String s) | public static String | xmlAttr(String name, String value) Creates an XML attribute of the form name="value". | public static String | xmlCData(String data) Converts the data to a CDATA element. | public static String | xmlComment(String data) Escapes a comment. | public static String | xmlNode(String name, String attributes, String content) Create an XML node with optional attributes and content. | public static String | xmlStartDoc() | public static String | xmlText(String text) Escapes an XML text element. |
arraySplit | public static String[] arraySplit(String s, char separatorChar, boolean trim)(Code) | | |
getDefaultCharset | public static String getDefaultCharset()(Code) | | |
indent | public static String indent(String s)(Code) | | Indents a string with 4 spaces.
Parameters: s - the string the indented string |
indent | public static String indent(String s, int spaces)(Code) | | Indents a string with spaces.
Parameters: s - the string Parameters: spaces - the number of spaces the indented string |
isNullOrEmpty | public static boolean isNullOrEmpty(String s)(Code) | | Check if a String is null or empty (the length is null).
true if it is null or empty |
pad | public static String pad(String string, int n, String padding, boolean right)(Code) | | Pad a string. This method is used for the SQL function RPAD and LPAD.
Parameters: string - the original string Parameters: n - the target length Parameters: padding - the padding string Parameters: right - true if the padding should be appended at the end the padded string |
quoteJavaIntArray | public static String quoteJavaIntArray(int[] array)(Code) | | |
utf8Decode | public static String utf8Decode(byte[] utf8)(Code) | | |
utf8Decode | public static String utf8Decode(byte[] bytes, int offset, int length)(Code) | | |
xmlAttr | public static String xmlAttr(String name, String value)(Code) | | Creates an XML attribute of the form name="value".
A single space is prepended to the name,
so that multiple attributes can be concatenated.
Parameters: name - Parameters: value - the attribute |
xmlCData | public static String xmlCData(String data)(Code) | | Converts the data to a CDATA element.
If the data contains ']]>', it is escaped as a text element.
Parameters: data - |
xmlComment | public static String xmlComment(String data)(Code) | | Escapes a comment.
If the data contains '--', it is converted to '- -'.
The data is indented with 4 spaces if it contains a newline character.
Parameters: data - |
xmlNode | public static String xmlNode(String name, String attributes, String content)(Code) | | Create an XML node with optional attributes and content.
The data is indented with 4 spaces if it contains a newline character.
Parameters: name - the element name Parameters: attributes - the attributes (may be null) Parameters: content - the content (may be null) the node |
xmlText | public static String xmlText(String text)(Code) | | Escapes an XML text element.
Parameters: text - the escaped text |
|
|