public class StringUtils extends Object
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
matches(String input,
String regex)
Whether or not the input String matches the given regular expression.
|
static String |
replaceAll(String input,
String regex,
String replacement)
Replaces each substring of
input that matches the given regular expression with the given replacement. |
static String |
replaceFirst(String input,
String regex,
String replacement)
Replaces the first substring of the input String that matches the given regular expression with the given replacement.
|
static String[] |
split(String input,
String regex)
Splits the input String around matches of the given regular expression.
|
static String[] |
split(String input,
String regex,
int limit)
Splits the input String around matches of the given regular expression
limit number of times. |
public static boolean matches(String input, String regex)
input
- String to match against the regexregex
- regular expression to match against the inputinput
matches the given regular expressionpublic static String[] split(String input, String regex)
input
- String to splitregex
- delimiting regular expressioninput
around matches of the given regular expressionpublic static String[] split(String input, String regex, int limit)
limit
number of times.input
- String to splitregex
- delimiting regular expressionlimit
- result thresholdinput
around matches of the given regular expressionpublic static String replaceAll(String input, String regex, String replacement)
input
that matches the given regular expression with the given replacement.input
- initial String to match against the regexregex
- regular expression to match against the inputreplacement
- the String to substitute for each matchString
public static String replaceFirst(String input, String regex, String replacement)
input
- the initial String to match against the regexregex
- the regular expression to match against the inputreplacement
- the String to substitute for the first matchString
Copyright © Veeva Systems 2017–2021. All rights reserved.