public class StringReplacements
extends java.lang.Object
SearchAndReplaceBuilder
Modifier and Type | Field and Description |
---|---|
static StringReplacement |
DELETE
Replacement that deletes the matching substring
|
static StringReplacement |
IGNORE
Replacement that leaves the matching substring unmodified
|
static StringReplacement |
SPACE_OR_NEWLINE
Replacement that converts the matching substring to a single space (if it does not contain any newlines) or a
newline (if it does contain a newline)
|
static StringReplacement |
TOLOWER
Replacement that converts the matching substring to lower case
|
static StringReplacement |
TOUPPER
Replacement that converts the matching substring to upper case
|
Constructor and Description |
---|
StringReplacements() |
Modifier and Type | Method and Description |
---|---|
static StringReplacement |
string(java.lang.CharSequence str)
Make a replacement that replaces matching substrings with a given string
|
static StringReplacement |
surround(java.lang.CharSequence prefix,
StringReplacement replacement,
java.lang.CharSequence suffix)
Make a replacement that surrounds matches with a given prefix and suffix, and applies the given replacer
to the match itself
|
public static final StringReplacement IGNORE
public static final StringReplacement DELETE
public static final StringReplacement TOUPPER
public static final StringReplacement TOLOWER
public static final StringReplacement SPACE_OR_NEWLINE
public static final StringReplacement string(java.lang.CharSequence str)
str
- replacement stringpublic static final StringReplacement surround(java.lang.CharSequence prefix, StringReplacement replacement, java.lang.CharSequence suffix)
prefix
- to put before matchesreplacement
- for the match itselfsuffix
- suffix to put after matches