public final class StringUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(java.lang.String string1,
java.lang.String string2)
Checks if two strings are equal.
|
static java.lang.String |
replace(java.lang.String text,
char oldChar,
char newChar)
Replaces all occurances of a character within chars with a new character.
|
static java.lang.String |
replace(java.lang.String text,
java.lang.String chars,
char newChar)
Replaces all occurances of characters of within chars with a new character.
|
public static java.lang.String replace(java.lang.String text, char oldChar, char newChar)
Example
StringUtil.replace("temp\test/test.txt", "\\/", '_')
results to "temp.test.test.txt"
text
- the text where to replace inoldChar
- old character to replacenewChar
- new character to replace withpublic static java.lang.String replace(java.lang.String text, java.lang.String chars, char newChar)
Example
StringUtil.replace("temp\test/test.txt", "\\/", '_')
results to "temp.test.test.txt"
text
- the text where to replace inchars
- list of characters to replacenewChar
- new character to replace withpublic static boolean equals(java.lang.String string1, java.lang.String string2)
null
or both strings are equal.string1
- a string to comparestring2
- another string to compare withtrue
if the two strings are equal,
else false
Submit a
bug or a
feature.
Created by
xsddoc, a sub project of
xframe, hosted at
http://www.sourceforge.net.