java.lang.Object | |
↳ | chan.util.StringUtils |
Provides some utilities to work with strings.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StringUtils.ReplacementCallback | Replacement callback for |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Removes all HTML tags and transforms mnemonics. | |||||||||||
Returns | |||||||||||
Returns whether strings are equals. | |||||||||||
Returns whether | |||||||||||
Returns whether | |||||||||||
Append HTML links to text. | |||||||||||
Returns the next index of the nearest of given | |||||||||||
Returns the next index of the nearest of given | |||||||||||
Returns | |||||||||||
Replaces all matches for | |||||||||||
Replaces all matches for compiled | |||||||||||
Removes all HTML tags and transforms mnemonics. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Removes all HTML tags and transforms mnemonics. This method will handle spaces and line breaks.
Parameters | |
---|---|
string |
String :
Source string. |
Returns | |
---|---|
String |
Cleared source string.
|
Returns string.toString()
if string
is not null
, otherwise returns empty string.
Parameters | |
---|---|
string |
CharSequence :
String instance. |
Returns | |
---|---|
String |
Not null string. |
See also:
Returns whether strings are equals. May handle null values.
Parameters | |
---|---|
first |
String :
String instance. |
second |
String :
String instance. |
Returns | |
---|---|
boolean |
True if strings are equals. |
Returns whether string
is null
or empty.
Parameters | |
---|---|
string |
CharSequence :
String instance. |
Returns | |
---|---|
boolean |
True if string is empty. |
Returns whether string
is null
, empty or contains only whitespaces.
Parameters | |
---|---|
string |
CharSequence :
String instance. |
Returns | |
---|---|
boolean |
True if string is empty or whitespace. |
Append HTML links to text.
Parameters | |
---|---|
string |
String :
Text to append links. |
Returns | |
---|---|
String |
Text with links. |
Returns the next index of the nearest of given what
char array in string
, or -1.
Parameters | |
---|---|
string |
String :
Where to search. |
start |
int :
Start offset. |
what |
char :
Char array to search. |
Returns | |
---|---|
int |
True if strings are equals. |
Returns the next index of the nearest of given what
string array in string
, or -1.
Parameters | |
---|---|
string |
String :
Where to search. |
start |
int :
Start offset. |
what |
String :
String array to search. |
Returns | |
---|---|
int |
True if strings are equals. |
Returns null
if string
is empty, otherwise returns string
.
Parameters | |
---|---|
string |
String :
String instance. |
Returns | |
---|---|
String |
Null string if s is empty. |
See also:
Replaces all matches for regularExpression
within given string
with the replacement
provided by replacementCallback
.
If the same regular expression is to be used for multiple operations, it may be more efficient to
use replaceAll(String, Pattern, ReplacementCallback)
method with compiled Pattern
.
Parameters | |
---|---|
string |
String :
Source string. |
regularExpression |
String :
Regular expression string. |
replacementCallback |
StringUtils.ReplacementCallback :
StringUtils.ReplacementCallback instance. |
Returns | |
---|---|
String |
Resulting string. |
Replaces all matches for compiled pattern
within given string
with the replacement
provided by replacementCallback
.
Parameters | |
---|---|
string |
String :
Source string. |
pattern |
Pattern :
Compiled regular expression. |
replacementCallback |
StringUtils.ReplacementCallback :
StringUtils.ReplacementCallback instance. |
Returns | |
---|---|
String |
Resulting string. |
Removes all HTML tags and transforms mnemonics. This method will not handle spaces and line breaks.
Parameters | |
---|---|
string |
String :
Source string. |
Returns | |
---|---|
String |
Escaped source string.
|