类 StringUtils
java.lang.Object
com.sh.common.exec.util.StringUtils
Description:
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringFixes the file separator char for the target platform using the following replacement. '/' File.separatorChar '\\' File.separatorCharstatic booleanDetermines if this is a quoted argument - either single or double quoted.static StringquoteArgument(String argument) Put quotes around the given String if necessary.static String[]Split a string into an array of strings based on a separator.static StringBufferstringSubstitution(String argStr, Map vars, boolean isLenient) Perform a series of substitutions.static StringConcatenates an array of string using a separator.
-
构造器详细资料
-
StringUtils
public StringUtils()
-
-
方法详细资料
-
stringSubstitution
Perform a series of substitutions. 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:- letter
- digit
- dot character
- hyphen character
- plus character
- underscore character
- 参数:
argStr- the argument string to be processedvars- name/value pairs used for substitutionisLenient- ignore a key not found in vars or throw a RuntimeException?- 返回:
- String target string with replacements.
-
split
Split a string into an array of strings based on a separator.- 参数:
input- what to splitsplitChar- what to split on- 返回:
- the array of strings
-
fixFileSeparatorChar
Fixes the file separator char for the target platform using the following replacement. '/' File.separatorChar '\\' File.separatorChar- 参数:
arg- the argument to fix- 返回:
- the transformed argument
-
toString
Concatenates an array of string using a separator.- 参数:
strings- the strings to concatenateseparator- the separator between two strings- 返回:
- the concatenated strings
-
quoteArgument
Put quotes around the given String if necessary.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 quoted- 返回:
- the quoted argument
- 抛出:
IllegalArgumentException- If argument contains both types of quotes
-
isQuoted
Determines if this is a quoted argument - either single or double quoted.- 参数:
argument- the argument to check- 返回:
- true when the argument is quoted
-