public class StringHandler
extends java.lang.Object
| Constructor and Description |
|---|
StringHandler() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(java.lang.String s1,
java.lang.String s2)
Return true if the String s1 contains the String s2.
|
static boolean |
containsIgnoreCase(java.lang.String s1,
java.lang.String s2)
Return true if the String s1 contains the String s2 ignoring case.
|
static java.lang.String |
replaceAll(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
Replace all occurrences of s2 in s1 with the replacement text.
|
static java.lang.String |
replaceAllIgnoreCase(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
Replace all occurrences of s2 in s1 with the replacement text.
|
static java.lang.String |
replaceFirst(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
Replace the first occurrence of s2 in s1 with the replacement text.
|
static java.lang.String |
replaceFirstIgnoreCase(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
Replace the first occurrence of s2 in s1 with the replacement text.
|
static java.util.ArrayList<java.lang.String> |
tokenize(java.lang.String s1,
java.lang.String separator,
boolean includeSeparator)
Tokenize the string based on the separator and return the tokens.
|
public static boolean contains(java.lang.String s1,
java.lang.String s2)
s1 - the first String.s2 - the second String.public static boolean containsIgnoreCase(java.lang.String s1,
java.lang.String s2)
s1 - the first String.s2 - the second String.public static java.lang.String replaceFirst(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
s1 - the String to change.s2 - the text to remove.replace - the text to replace s2 with.public static java.lang.String replaceFirstIgnoreCase(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
s2 in s1, but add replace as is.s1 - the String to change.s2 - the text to remove.replace - the text to replace s2 with.public static java.lang.String replaceAll(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
s1 - the String to change.s2 - the text to remove.replace - the text to replace s2 with.public static java.lang.String replaceAllIgnoreCase(java.lang.String s1,
java.lang.String s2,
java.lang.String replace)
s2 in s1, but add replace as is.s1 - the String to change.s2 - the text to remove.replace - the text to replace s2 with.public static java.util.ArrayList<java.lang.String> tokenize(java.lang.String s1,
java.lang.String separator,
boolean includeSeparator)
s1 - the string to tokenize.separator - the character sequence to separate tokens.includeSeparator - if true include separator string as tokens.