header

net.sf.xframe.xsddoc.util
Class StringUtil

java.lang.Object
  extended bynet.sf.xframe.xsddoc.util.StringUtil

public final class StringUtil
extends java.lang.Object

String Utility methods.

Author:
Kurt Riede

Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replace

public 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.

Example
StringUtil.replace("temp\test/test.txt", "\\/", '_')
results to "temp.test.test.txt"

Parameters:
text - the text where to replace in
oldChar - old character to replace
newChar - new character to replace with
Returns:
replaced text

replace

public 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.

Example
StringUtil.replace("temp\test/test.txt", "\\/", '_')
results to "temp.test.test.txt"

Parameters:
text - the text where to replace in
chars - list of characters to replace
newChar - new character to replace with
Returns:
replaced text

equals

public static boolean equals(java.lang.String string1,
                             java.lang.String string2)
Checks if two strings are equal. The two strings are considered equal, if both references are null or both strings are equal.

Parameters:
string1 - a string to compare
string2 - another string to compare with
Returns:
true if the two strings are equal, else false

header

Submit a bug or a feature.
Created by xsddoc, a sub project of xframe, hosted at http://www.sourceforge.net.