public class StringUtils
extends java.lang.Object
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
fixFileSeparatorChar(java.lang.String arg)
Fixes the file separator char for the target platform
using the following replacement.
|
static boolean |
isQuoted(java.lang.String argument)
Determines if this is a quoted argument - either single or
double quoted.
|
static java.lang.String |
quoteArgument(java.lang.String argument)
Put quotes around the given String if necessary.
|
static java.lang.String[] |
split(java.lang.String input,
java.lang.String splitChar)
Split a string into an array of strings based
on a separator.
|
static java.lang.StringBuffer |
stringSubstitution(java.lang.String argStr,
java.util.Map<? super java.lang.String,?> vars,
boolean isLenient)
Perform a series of substitutions.
|
static java.lang.String |
toString(java.lang.String[] strings,
java.lang.String separator)
Concatenates an array of string using a separator.
|
public static java.lang.StringBuffer stringSubstitution(java.lang.String argStr, java.util.Map<? super java.lang.String,?> vars, boolean isLenient)
The substitutions are performed by replacing ${variable} in the target string with the value of provided by the key "variable" in the provided hash table.
A key consists of the following characters:
argStr
- the argument string to be processedvars
- name/value pairs used for substitutionisLenient
- ignore a key not found in vars or throw a RuntimeException?public static java.lang.String[] split(java.lang.String input, java.lang.String splitChar)
input
- what to splitsplitChar
- what to split onpublic static java.lang.String fixFileSeparatorChar(java.lang.String arg)
arg
- the argument to fixpublic static java.lang.String toString(java.lang.String[] strings, java.lang.String separator)
strings
- the strings to concatenateseparator
- the separator between two stringspublic static java.lang.String quoteArgument(java.lang.String argument)
If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.
argument
- the argument to be quotedjava.lang.IllegalArgumentException
- If argument contains both types of quotespublic static boolean isQuoted(java.lang.String argument)
argument
- the argument to check"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"