public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(String s1,
String s2)
Return true if the two strings are equal (like String.equals(), but
allowing null values for both operands).
|
static void |
main(String[] args)
test main
|
static boolean |
match(String pattern,
String string)
Checks whether a string matches a given wildcard pattern.
|
static String |
replace(String source,
String target,
String replacement)
Replace all occurances of the given target string with the given
replacement string in the source string.
|
static String[] |
split(String s,
int sep)
Split the string s at the given separator char, if found, and return
an array containing the two resulting strings, or null if the separator
char was not found.
|
public static String replace(String source, String target, String replacement)
source
- source string to be searchedtarget
- the target string to replacereplacement
- the value to replace the target string withpublic static String[] split(String s, int sep)
public static boolean equals(String s1, String s2)
public static boolean match(String pattern, String string)
public static void main(String[] args)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.