Class StringUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Helper to get bytes from string with UTF-8 encodingstatic StringJoins a list or array of objects together using the specified delimiter.static StringJoins a list or array of objects together using the specified delimiter.static StringnewString(byte[] b) Helper to get string from bytes with UTF-8 encodingstatic StringnewString(byte[] b, int offset, int length) Helper to get string from bytes with UTF-8 encodingstatic StringreplaceAll(String source, String pattern, String replace) This method replaces all occurrences of the pattern with the replacement Stringstatic StringreplaceFirst(String source, String pattern, String replace) This method replaces the first occurrence of the pattern with the replacement Stringstatic voidDeprecated
Breaks a String to multiple strings.Breaks a String to multiple strings (similar to string tokenizer)static VectortokenizeString(String source, char separator) Breaks a String to multiple strings.static VectortokenizeString(String source, String separator) Breaks a String to multiple strings (similar to string tokenizer)Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
setImplementation
Deprecated
exposed as part of an internal optimization, this method isn't meant for general access
-
replaceAll
This method replaces all occurrences of the pattern with the replacement String
Parameters
-
source: the String source -
pattern: String to replace in the source -
replace: replacement String
Returns
string with replaced elements
-
-
replaceFirst
This method replaces the first occurrence of the pattern with the replacement String
Parameters
-
source: the String source -
pattern: String to replace in the source -
replace: replacement String
Returns
string with replaced elements
-
-
tokenizeString
-
tokenizeString
Breaks a String to multiple strings (similar to string tokenizer)
Parameters
-
source: the String to break -
separator: the characters that can be used to search and break.
Returns
a Vector of Strings
Deprecated
use the
java.lang.String)method instead -
-
tokenize
-
tokenize
-
join
-
join
-
getBytes
Helper to get bytes from string with UTF-8 encoding
Parameters
s: the string
Returns
the bytes
-
newString
Helper to get string from bytes with UTF-8 encoding
Parameters
b: the bytes
Returns
the string
-
newString
Helper to get string from bytes with UTF-8 encoding
Parameters
-
b: the bytes -
offset: the offset -
length: the length
Returns
the string
-
-