|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjsky.util.StringUtil
public class StringUtil
Contains static String utility methods.
| Constructor Summary | |
|---|---|
StringUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
arrayContains(java.lang.String[] ar,
java.lang.String s)
Return true if the given array contains the given String |
static java.lang.String |
combine(java.lang.String[] ar,
java.lang.String sep)
Combine the given array of strings to a single string and return the result. |
static boolean |
equals(java.lang.String s1,
java.lang.String s2)
Return true if the two strings are equal (like String.equals(), but allowing null values for both operands). |
static void |
main(java.lang.String[] args)
test main |
static boolean |
match(java.lang.String pattern,
java.lang.String string)
Checks whether a string matches a given wildcard pattern. |
static java.lang.String |
pad(java.lang.String s,
int length,
boolean leftJustify)
Pad the given string to the given length with blanks on the left or right, depending on the value of the leftJustify argument. |
static java.lang.String |
replace(java.lang.String source,
java.lang.String target,
java.lang.String replacement)
Replace all occurances of the given target string with the given replacement string in the source string. |
static java.lang.String[] |
split(java.lang.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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtil()
| Method Detail |
|---|
public static java.lang.String replace(java.lang.String source,
java.lang.String target,
java.lang.String replacement)
source - source string to be searchedtarget - the target string to replacereplacement - the value to replace the target string with
public static java.lang.String[] split(java.lang.String s,
int sep)
public static java.lang.String combine(java.lang.String[] ar,
java.lang.String sep)
ar - an array of Strings, one element for each Tcl list itemsep - put this between the strings
public static boolean equals(java.lang.String s1,
java.lang.String s2)
public static boolean match(java.lang.String pattern,
java.lang.String string)
public static java.lang.String pad(java.lang.String s,
int length,
boolean leftJustify)
s - the source stringlength - fill the string with blanks if it is less than this lengthleftJustify - if true, add blanks after the s, otherwise before
public static boolean arrayContains(java.lang.String[] ar,
java.lang.String s)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||