| java.lang.Object org.wings.util.StringUtil
StringUtil | public class StringUtil (Code) | | Some string manipulation utilities.
author: Armin Haaf |
Field Summary | |
final public static int | MAX_RADIX |
Method Summary | |
final public static String[] | concat(String[] s1, String[] s2) concatenates two arrays of strings.
Parameters: s1 - the first array of strings. Parameters: s2 - the second array of strings. | public static String | delimitedString(Object[] array) | final public static String | replace(String s, String toFind, String replace) replaces substrings with content 'toFind' with 'replace' in
s and returns the result ('s/$toFind/$replace/g')
Parameters: s - The String the substrings should be replaced in. Parameters: toFind - The substring to be replaced Parameters: replace - The replacement. | final public static String | replaceNewLines(String s, String r) replaces all newlines in the given String 's' with the replacement
string 'r'. | public static String | toIdentifierString(long val) creates a shortest possible string representation of the given
long number that qualifies as an identifier in common programming
languages (and HTML-id's :-)
That is, it must start with a letter. | public static String | toShortestAlphaNumericString(long i) generates a shortest representation as string for the given long. | public static String | toShortestAlphaNumericString(long i, int minDigits) generates a shortest representation as string for the given with
at least minDigits digits. | public static String | toString(long i, int radix, int minDigits) Codes number up to radix 62.
Note, this method is only public for backward compatiblity. |
MAX_RADIX | final public static int MAX_RADIX(Code) | | |
concat | final public static String[] concat(String[] s1, String[] s2)(Code) | | concatenates two arrays of strings.
Parameters: s1 - the first array of strings. Parameters: s2 - the second array of strings. the resulting array with all strings in s1 and s2 |
replace | final public static String replace(String s, String toFind, String replace)(Code) | | replaces substrings with content 'toFind' with 'replace' in
s and returns the result ('s/$toFind/$replace/g')
Parameters: s - The String the substrings should be replaced in. Parameters: toFind - The substring to be replaced Parameters: replace - The replacement. the string with all replacements. |
replaceNewLines | final public static String replaceNewLines(String s, String r)(Code) | | replaces all newlines in the given String 's' with the replacement
string 'r'. Each line is trimmed from leading and trailing whitespaces,
then the new line-delimiter is added.
Parameters: s - the source string. Parameters: r - the new line delimiter the resulting string. |
toIdentifierString | public static String toIdentifierString(long val)(Code) | | creates a shortest possible string representation of the given
long number that qualifies as an identifier in common programming
languages (and HTML-id's :-)
That is, it must start with a letter.
Parameters: val - the long value to be encoded a string represantation of the given value that qualifiesas an identifier. |
toShortestAlphaNumericString | public static String toShortestAlphaNumericString(long i)(Code) | | generates a shortest representation as string for the given long.
This is used to generate session or resource IDs.
|
toShortestAlphaNumericString | public static String toShortestAlphaNumericString(long i, int minDigits)(Code) | | generates a shortest representation as string for the given with
at least minDigits digits. Unused digits are padded with zero.
|
toString | public static String toString(long i, int radix, int minDigits)(Code) | | Codes number up to radix 62.
Note, this method is only public for backward compatiblity. don't
use it.
Parameters: minDigits - returns a string with a least minDigits digits |
|
|