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)
-
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
-
-