public class StringUtils2 extends Object
StringUtils class.| Modifier and Type | Method and Description |
|---|---|
static void |
appendEscapedNonAlphaNumericChars(String str,
boolean escapeDot,
StringBuilder result)
Escape all non a->z,A->Z, 0->9 and '-' with a '_'.
|
static void |
appendEscapedNonAlphaNumericChars(String str,
StringBuilder result)
Escape all non a->z,A->Z, 0->9 and '-' with a '_'.
|
static List<String> |
delimitedStringToList(String delimitedString)
Split given String.
|
static String |
join(List<String> tokens,
String delimiter)
Join given
tokens with given delimiter. |
static String |
reverseTokens(String str,
String delimiter)
Reverse tokens of given tokenized
str. |
public static List<String> delimitedStringToList(@Nullable String delimitedString)
",", ";" and "\n".delimitedString - null if given delimitedString is nullpublic static String join(@Nullable List<String> tokens, @Nonnull String delimiter)
tokens with given delimiter.
Sample: tokens "com", "mycompany, "ecommerce", "server1" with delimiter "."
returns "com.mycompany.ecommerce.server1".tokens - delimiter - null if given tokens is nullpublic static String reverseTokens(@Nullable String str, @Nonnull String delimiter)
Reverse tokens of given tokenized str.
Sample: "server1.ecommerce.mycompany.com" returns "com.mycompany.ecommerce.server1".
str - delimiter - null if given string is nullpublic static void appendEscapedNonAlphaNumericChars(@Nonnull String str, boolean escapeDot, @Nonnull StringBuilder result)
escapeDot is true.str - the string to escapeescapeDot - indicates whether '.' should be escaped into '_' or not.result - the StringBuilder in which the escaped string is appendedpublic static void appendEscapedNonAlphaNumericChars(@Nonnull String str, @Nonnull StringBuilder result)
str - the string to escaperesult - the StringBuilder in which the escaped string is appendedCopyright © 2015. All Rights Reserved.