程序包 dev.utils.common
类 StringUtils
java.lang.Object
dev.utils.common.StringUtils
detail: 字符串工具类
- 作者:
- Ttt
-
方法概要
修饰符和类型方法说明static StringappendLine(int number) 追加换行static StringappendLine2(int number) 追加换行static StringBuilderappends(StringBuilder builder, String split, Object... args) StringBuilder 拼接处理static StringBuilderappendsIgnoreLast(StringBuilder builder, String split, Object... args) StringBuilder 拼接处理 ( 最后一个不追加间隔 )static StringappendSpace(int number) 追加空格static StringappendTab(int number) 追加 Tabstatic StringargsFormat(Object... args) 根据可变参数数量自动格式化static String将字符串转移为 ASCII 码static String驼峰命名法转为下划线命名static boolean检测字符串是否全是中文static StringcheckValue(String str) 检查字符串static StringcheckValue(String defaultStr, String str) 检查字符串static StringcheckValue(String defaultStr, String value1, String value2) 检查字符串 ( 单独检查两个值 )static StringcheckValues(String defaultStr, String... args) 检查字符串 ( 多个值 )static StringcheckValuesSpace(String defaultStr, String... args) 检查字符串 ( 多个值, 删除前后空格对比判断 )static StringclearEndsWith(String str, String suffix) 清空特定字符串结尾的字符串 如 _____a_a_a_a_____ 传入 _ 等于 _____a_a_a_astatic String清空字符串全部换行符static StringclearLine2(String str) 清空字符串全部换行符static StringclearLineTrim(String str) 清空字符串前后全部换行符static StringclearLineTrim2(String str) 清空字符串前后全部换行符static StringclearSEWiths(String str, String suffix) 清空特定字符串开头、结尾的字符串 如 _____a_a_a_a_____ 传入 _ 等于 a_a_a_astatic StringclearSpace(String str) 清空字符串全部空格static StringclearSpaceTabLine(String str) 清空字符串全部空格、Tab、换行符static String清空字符串前后全部空格、Tab、换行符static StringclearSpaceTrim(String str) 清空字符串前后全部空格static StringclearStartsWith(String str, String suffix) 清空特定字符串开头的字符串 如 _____a_a_a_a_____ 传入 _ 等于 a_a_a_a_____static String清空字符串全部 Tabstatic StringclearTabTrim(String str) 清空字符串前后全部 Tabstatic StringcolonSplit(String str) 冒号分割处理static String字符串连接, 将参数列表拼接为一个字符串static StringconcatSpiltWith(String split, Object... args) 字符串连接, 将参数列表拼接为一个字符串static StringconcatSpiltWithIgnoreLast(String split, Object... args) 字符串连接, 将参数列表拼接为一个字符串 ( 最后一个不追加间隔 )static StringconvertHideMobile(String phone) 转换手机号static StringconvertHideMobile(String phone, String symbol) 转换手机号static StringconvertSymbolHide(int start, String str, String symbol) 转换符号处理static intcountMatches(String str, String keyword) 统计字符串匹配个数static intcountMatches2(String str, String keyword) 统计字符串匹配个数static String转化为半角字符static <T> booleanequals(T value1, T value2) 判断两个值是否一样static booleanequalsIgnoreCase(String value1, String value2) 判断两个值是否一样 ( 忽略大小写 )static booleanequalsIgnoreCaseNotNull(String value1, String value2) 判断两个值是否一样 ( 忽略大小写 )static <T> booleanequalsNotNull(T value1, T value2) 判断两个值是否一样 ( 非 null 判断 )static String字符串格式化static String循环指定数量字符串static Stringgbk2312Encode(String str) 字符串进行 GBK2312 编码static String字符串进行 GBK 编码static byte[]字符串 转 byte[]static String获取字符串 ( 判 null )static String获取字符串 ( 判 null )static String获取字符串 ( 判 null )static String获取字符串 ( 判 null )static booleanisChinese(char ch) 判断输入汉字static booleanisContains(boolean isIgnore, String str, String... args) 判断一堆值中, 是否存在符合该条件的 ( 包含 )static booleanisContains(String str, String... args) 判断一堆值中, 是否存在符合该条件的 ( 包含 )static booleanisEmpty(CharSequence str) 判断字符串是否为 nullstatic booleanisEmpty(CharSequence... args) 判断多个字符串是否存在为 null 的字符串static booleanisEmptyClear(String str) 判断字符串是否为 null ( 调用 clearSpaceTabLineTrim )static booleanisEmptyClear(String... args) 判断多个字符串是否存在为 null 的字符串 ( 调用 clearSpaceTabLineTrim )static booleanisEndsWith(boolean isIgnore, String str, String... args) 判断内容, 是否属于特定字符串结尾static booleanisEndsWith(String str, String... args) 判断内容, 是否属于特定字符串结尾 ( 对比大小写 )static boolean判断多个字符串是否相等, 只有全相等才返回 truestatic boolean判断多个字符串是否相等, 只有全相等才返回 true ( 对比大小写 )static boolean获取字符串长度 是否等于期望长度static booleanisNotEmpty(CharSequence str) 判断字符串是否不为 nullstatic booleanisNotEmptyClear(String str) 判断字符串是否不为 null ( 调用 clearSpaceTabLineTrim )static boolean判断字符串是否不为 "null"static booleanisNotNullClear(String str) 判断字符串是否不为 "null" ( 调用 clearSpaceTabLineTrim )static boolean判断字符串是否为 "null"static boolean判断多个字符串是否存在为 "null" 的字符串static booleanisNullClear(String str) 判断字符串是否为 "null" ( 调用 clearSpaceTabLineTrim )static booleanisNullClear(String... args) 判断多个字符串是否存在为 "null" 的字符串 ( 调用 clearSpaceTabLineTrim )static booleanisOrEquals(boolean isIgnore, String str, String... args) 判断多个字符串, 只要有一个符合条件则通过static booleanisOrEquals(String str, String... args) 判断多个字符串, 只要有一个符合条件则通过static booleanisSpace(CharSequence str) 判断字符串是否为 null 或全为空白字符static booleanisStartsWith(boolean isIgnore, String str, String... args) 判断内容, 是否属于特定字符串开头static booleanisStartsWith(String str, String... args) 判断内容, 是否属于特定字符串开头 ( 对比大小写 )static String循环拼接static String循环拼接static String循环拼接static int获取字符串长度static int获取字符串长度static StringlowerFirstLetter(String str) 首字母小写static StringreplaceAll(String str, String suffix, String replace) 替换字符串static StringreplaceAlls(String str, String[] suffixArrays, String[] replaceArrays) 替换字符串static StringreplaceAllToNull(String str, String suffix, String replace) 替换字符串static StringreplaceEndsWith(String str, String suffix) 替换结尾字符串static StringreplaceEndsWith(String str, String suffix, String replace) 替换结尾字符串static StringreplaceSEWith(String str, String suffix) 替换特定字符串开头、结尾的字符串 如 _____a_a_a_a_____ 传入 _ 等于 ____a_a_a_a____static StringreplaceSEWith(String str, String suffix, String replace) 替换特定字符串开头、结尾的字符串 如 _____a_a_a_a_____ 传入 _, c 等于 c____a_a_a_a____cstatic StringreplaceStartsWith(String str, String prefix) 替换开头字符串static StringreplaceStartsWith(String str, String prefix, String startAppend) 替换开头字符串static String反转字符串static String转化为全角字符 如: a = a, A = Astatic String[]拆分字符串static String拆分字符串获取指定索引static String拆分字符串获取指定索引static StringsqliteEscape(String str) 字符串数据库字符转义static String进行字符串编码static StringsubEllipsize(int maxLength, String str, String symbol) 裁剪超出的内容, 并且追加符号 ( 如 ... )static StringsubSetSymbol(String str, int frontRetainLength, int rearRetainLength, String symbol) 裁剪内容 ( 设置符号处理 )static String裁剪字符串static String裁剪字符串static String裁剪字符串static StringsubSymbolHide(int start, int symbolNumber, String str, String symbol) 裁剪符号处理static String下划线命名转为驼峰命名static String将字符串转移为 Unicode 码static StringunicodeString(char[] chars) 将字符数组转移为 Unicode 码static StringupperFirstLetter(String str) 首字母大写static String进行 URL 解码, 默认 UTF-8static String进行 URL 解码static StringurlDecodeWhile(String str, int threshold) 进行 URL 解码, 默认 UTF-8 ( 循环到非 URL 编码为止 )static StringurlDecodeWhile(String str, String enc, int threshold) 进行 URL 解码 ( 循环到非 URL 编码为止 )static String进行 URL 编码, 默认 UTF-8static String进行 URL 编码static Stringutf8Encode(String str) 字符串进行 UTF-8 编码
-
方法详细资料
-
isEmpty
判断字符串是否为 null- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isEmpty
判断多个字符串是否存在为 null 的字符串- 参数:
args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isEmptyClear
判断字符串是否为 null ( 调用 clearSpaceTabLineTrim )- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isEmptyClear
判断多个字符串是否存在为 null 的字符串 ( 调用 clearSpaceTabLineTrim )- 参数:
args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isNotEmpty
判断字符串是否不为 null- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isNotEmptyClear
判断字符串是否不为 null ( 调用 clearSpaceTabLineTrim )- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isNull
判断字符串是否为 "null"- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isNull
判断多个字符串是否存在为 "null" 的字符串- 参数:
args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isNullClear
判断字符串是否为 "null" ( 调用 clearSpaceTabLineTrim )- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isNullClear
判断多个字符串是否存在为 "null" 的字符串 ( 调用 clearSpaceTabLineTrim )- 参数:
args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isNotNull
判断字符串是否不为 "null"- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
isNotNullClear
判断字符串是否不为 "null" ( 调用 clearSpaceTabLineTrim )- 参数:
str- 待校验的字符串- 返回:
trueyes,falseno
-
length
获取字符串长度- 参数:
str- 待校验的字符串- 返回:
- 字符串长度, 如果字符串为 null, 则返回 0
-
length
获取字符串长度- 参数:
str- 待校验的字符串defaultLength- 字符串为 null 时, 返回的长度- 返回:
- 字符串长度, 如果字符串为 null, 则返回 defaultLength
-
isLength
获取字符串长度 是否等于期望长度- 参数:
str- 待校验的字符串length- 期望长度- 返回:
trueyes,falseno
-
equals
public static <T> boolean equals(T value1, T value2) 判断两个值是否一样- 类型参数:
T- 泛型- 参数:
value1- 第一个值value2- 第二个值- 返回:
trueyes,falseno
-
equalsNotNull
public static <T> boolean equalsNotNull(T value1, T value2) 判断两个值是否一样 ( 非 null 判断 )- 类型参数:
T- 泛型- 参数:
value1- 第一个值value2- 第二个值- 返回:
trueyes,falseno
-
equalsIgnoreCase
判断两个值是否一样 ( 忽略大小写 )- 参数:
value1- 第一个值value2- 第二个值- 返回:
trueyes,falseno
-
equalsIgnoreCaseNotNull
判断两个值是否一样 ( 忽略大小写 )- 参数:
value1- 第一个值value2- 第二个值- 返回:
trueyes,falseno
-
isEquals
判断多个字符串是否相等, 只有全相等才返回 true ( 对比大小写 )- 参数:
args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isEquals
判断多个字符串是否相等, 只有全相等才返回 true- 参数:
isIgnore- 是否忽略大小写args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isOrEquals
判断多个字符串, 只要有一个符合条件则通过- 参数:
str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isOrEquals
判断多个字符串, 只要有一个符合条件则通过- 参数:
isIgnore- 是否忽略大小写str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isContains
判断一堆值中, 是否存在符合该条件的 ( 包含 )- 参数:
str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isContains
判断一堆值中, 是否存在符合该条件的 ( 包含 )- 参数:
isIgnore- 是否忽略大小写str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isStartsWith
判断内容, 是否属于特定字符串开头 ( 对比大小写 )- 参数:
str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isStartsWith
判断内容, 是否属于特定字符串开头- 参数:
isIgnore- 是否忽略大小写str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isEndsWith
判断内容, 是否属于特定字符串结尾 ( 对比大小写 )- 参数:
str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
isEndsWith
判断内容, 是否属于特定字符串结尾- 参数:
isIgnore- 是否忽略大小写str- 待校验的字符串args- 待校验的字符串数组- 返回:
trueyes,falseno
-
countMatches
统计字符串匹配个数- 参数:
str- 待匹配字符串keyword- 匹配 key- 返回:
- 字符串 key 匹配个数
-
countMatches2
统计字符串匹配个数- 参数:
str- 待匹配字符串keyword- 匹配 key- 返回:
- 字符串 key 匹配个数
-
isSpace
判断字符串是否为 null 或全为空白字符- 参数:
str- 待校验字符串- 返回:
trueyes,falseno
-
getBytes
字符串 转 byte[]- 参数:
str- 待处理字符串- 返回:
- byte[]
-
clearSpace
清空字符串全部空格- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearTab
清空字符串全部 Tab- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearLine
清空字符串全部换行符- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearLine2
清空字符串全部换行符- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearSpaceTrim
清空字符串前后全部空格- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearTabTrim
清空字符串前后全部 Tab- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearLineTrim
清空字符串前后全部换行符- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearLineTrim2
清空字符串前后全部换行符- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearSpaceTabLine
清空字符串全部空格、Tab、换行符- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
clearSpaceTabLineTrim
清空字符串前后全部空格、Tab、换行符- 参数:
str- 待处理字符串- 返回:
- 处理后的字符串
-
appendSpace
追加空格- 参数:
number- 空格数量- 返回:
- 指定数量的空格字符串
-
appendTab
追加 Tab- 参数:
number- tab 键数量- 返回:
- 指定数量的 Tab 字符串
-
appendLine
追加换行- 参数:
number- 换行数量- 返回:
- 指定数量的换行字符串
-
appendLine2
追加换行- 参数:
number- 换行数量- 返回:
- 指定数量的换行字符串
-
forString
循环指定数量字符串- 参数:
number- 空格数量str- 待追加字符串- 返回:
- 指定数量字符串
-
joinArgs
循环拼接- 参数:
delimiter- 拼接符号values- 待拼接对象- 返回:
- 拼接后的值
-
join
循环拼接- 参数:
delimiter- 拼接符号values- 待拼接对象- 返回:
- 拼接后的值
-
join
循环拼接- 参数:
delimiter- 拼接符号iterable- 待拼接对象- 返回:
- 拼接后的值
-
colonSplit
冒号分割处理- 参数:
str- 待处理字符串- 返回:
- 冒号分割后的字符串
-
getString
获取字符串 ( 判 null )- 参数:
str- 待校验的字符串- 返回:
- 校验后的字符串
-
getString
获取字符串 ( 判 null )- 参数:
str- 待校验的字符串defaultStr- 默认字符串- 返回:
- 校验后的字符串
-
getString
获取字符串 ( 判 null )- 参数:
object- 待校验的对象- 返回:
- 校验后的字符串
-
getString
获取字符串 ( 判 null )- 参数:
object- 待校验的对象defaultStr- 默认字符串- 返回:
- 校验后的字符串
-
checkValue
检查字符串- 参数:
str- 待校验字符串- 返回:
- 如果待校验字符串为 null, 则返回默认字符串, 如果不为 null, 则返回该字符串
-
checkValue
检查字符串- 参数:
defaultStr- 默认字符串str- 待校验字符串- 返回:
- 如果待校验字符串为 null, 则返回 defaultStr, 如果不为 null, 则返回该字符串
-
checkValue
检查字符串 ( 单独检查两个值 )- 参数:
defaultStr- 默认字符串value1- 第一个待校验字符串value2- 第二个待校验字符串- 返回:
- 两个待校验字符串中不为 null 的字符串, 如果都为 null, 则返回 defaultStr
-
checkValues
检查字符串 ( 多个值 )- 参数:
defaultStr- 默认字符串args- 待校验字符串数组- 返回:
- 字符串数组中不为 null 的字符串, 如果都为 null, 则返回 defaultStr
-
checkValuesSpace
检查字符串 ( 多个值, 删除前后空格对比判断 )- 参数:
defaultStr- 默认字符串args- 待校验字符串数组- 返回:
- 字符串数组中不为 null 的字符串, 如果都为 null, 则返回 defaultStr
-
format
字符串格式化- 参数:
format- 待格式化字符串args- 格式化参数- 返回:
- 格式化后的字符串
-
argsFormat
根据可变参数数量自动格式化- 参数:
args- 格式化参数- 返回:
- 格式化后的字符串
-
concat
字符串连接, 将参数列表拼接为一个字符串- 参数:
args- 追加数据- 返回:
- 拼接后的字符串
-
concatSpiltWith
字符串连接, 将参数列表拼接为一个字符串- 参数:
split- 追加间隔args- 追加数据- 返回:
- 拼接后的字符串
-
concatSpiltWithIgnoreLast
字符串连接, 将参数列表拼接为一个字符串 ( 最后一个不追加间隔 )- 参数:
split- 追加间隔args- 追加数据- 返回:
- 拼接后的字符串
-
appends
StringBuilder 拼接处理- 参数:
builder- 拼接 Buildersplit- 追加间隔args- 拼接数据源- 返回:
StringBuilder
-
appendsIgnoreLast
StringBuilder 拼接处理 ( 最后一个不追加间隔 )- 参数:
builder- 拼接 Buildersplit- 追加间隔args- 拼接数据源- 返回:
StringBuilder
-
gbkEncode
字符串进行 GBK 编码- 参数:
str- 待处理字符串- 返回:
- GBK 编码后的字符串
-
gbk2312Encode
字符串进行 GBK2312 编码- 参数:
str- 待处理字符串- 返回:
- GBK2312 编码后的字符串
-
utf8Encode
字符串进行 UTF-8 编码- 参数:
str- 待处理字符串- 返回:
- UTF-8 编码后的字符串
-
strEncode
进行字符串编码- 参数:
str- 待处理字符串enc- 编码格式- 返回:
- 指定编码格式编码后的字符串
-
urlEncode
进行 URL 编码, 默认 UTF-8- 参数:
str- 待处理字符串- 返回:
- UTF-8 编码格式 URL 编码后的字符串
-
urlEncode
进行 URL 编码- 参数:
str- 待处理字符串enc- 编码格式- 返回:
- 指定编码格式 URL 编码后的字符串
-
urlDecode
进行 URL 解码, 默认 UTF-8- 参数:
str- 待处理字符串- 返回:
- UTF-8 编码格式 URL 解码后的字符串
-
urlDecode
进行 URL 解码- 参数:
str- 待处理字符串enc- 解码格式- 返回:
- 指定编码格式 URL 解码后的字符串
-
urlDecodeWhile
进行 URL 解码, 默认 UTF-8 ( 循环到非 URL 编码为止 )- 参数:
str- 待处理字符串threshold- 解码次数阈值, 超过该次数还未完成则直接返回- 返回:
- UTF-8 编码格式 URL 解码后的字符串
-
urlDecodeWhile
进行 URL 解码 ( 循环到非 URL 编码为止 )- 参数:
str- 待处理字符串enc- 解码格式threshold- 解码次数阈值, 超过该次数还未完成则直接返回- 返回:
- 指定编码格式 URL 解码后的字符串
-
ascii
将字符串转移为 ASCII 码- 参数:
str- 待处理字符串- 返回:
- 字符串转 ASCII 码后的字符串
-
unicode
将字符串转移为 Unicode 码- 参数:
str- 待处理字符串- 返回:
- 字符串转 Unicode 码后的字符串
-
unicodeString
将字符数组转移为 Unicode 码- 参数:
chars- char[]- 返回:
- char[] 转 Unicode 码后的字符串
-
dbc
转化为半角字符- 参数:
str- 待处理字符串- 返回:
- 转换半角字符串
-
sbc
转化为全角字符 如: a = a, A = A- 参数:
str- 待处理字符串- 返回:
- 转换全角字符串
-
checkChineseToString
检测字符串是否全是中文- 参数:
str- 待校验字符串- 返回:
trueyes,falseno
-
isChinese
public static boolean isChinese(char ch) 判断输入汉字- 参数:
ch- 待校验字符- 返回:
trueyes,falseno
-
upperFirstLetter
首字母大写- 参数:
str- 待处理字符串- 返回:
- 首字母大写字符串
-
lowerFirstLetter
首字母小写- 参数:
str- 待处理字符串- 返回:
- 首字母小写字符串
-
reverse
反转字符串- 参数:
str- 待处理字符串- 返回:
- 反转字符串
-
underScoreCaseToCamelCase
下划线命名转为驼峰命名- 参数:
str- 下划线命名格式字符串- 返回:
- 驼峰命名格式字符串
-
camelCaseToUnderScoreCase
驼峰命名法转为下划线命名- 参数:
str- 驼峰命名格式字符串- 返回:
- 下划线命名格式字符串
-
sqliteEscape
字符串数据库字符转义- 参数:
str- 待处理字符串- 返回:
- 转义处理后的字符串
-
convertHideMobile
转换手机号- 参数:
phone- 待处理字符串- 返回:
- 处理后的字符串
-
convertHideMobile
转换手机号- 参数:
phone- 待处理字符串symbol- 转换符号- 返回:
- 处理后的字符串
-
convertSymbolHide
转换符号处理- 参数:
start- 开始位置str- 待处理字符串symbol- 转换符号- 返回:
- 处理后的字符串
-
subEllipsize
裁剪超出的内容, 并且追加符号 ( 如 ... )- 参数:
maxLength- 允许最大的长度str- 待处理字符串symbol- 转换符号- 返回:
- 处理后的字符串
-
subSymbolHide
裁剪符号处理- 参数:
start- 开始位置symbolNumber- 转换数量str- 待处理字符串symbol- 转换符号- 返回:
- 处理后的字符串
-
subSetSymbol
public static String subSetSymbol(String str, int frontRetainLength, int rearRetainLength, String symbol) 裁剪内容 ( 设置符号处理 )- 参数:
str- 待处理字符串frontRetainLength- 前面保留的长度rearRetainLength- 后面保留的长度symbol- 转换符号- 返回:
- 处理后的字符串
-
substring
裁剪字符串- 参数:
str- 待裁剪字符串endIndex- 结束裁剪的位置- 返回:
- 裁剪后的字符串
-
substring
裁剪字符串- 参数:
str- 待裁剪字符串endIndex- 结束裁剪的位置isReturn- 开始位置超过限制是否返回内容- 返回:
- 裁剪后的字符串
-
substring
裁剪字符串- 参数:
str- 待裁剪字符串beginIndex- 开始裁剪的位置endIndex- 结束裁剪的位置isReturn- 开始位置超过限制是否返回内容- 返回:
- 裁剪后的字符串
-
replaceSEWith
替换特定字符串开头、结尾的字符串 如 _____a_a_a_a_____ 传入 _ 等于 ____a_a_a_a____- 参数:
str- 待处理字符串suffix- 替换符号字符串- 返回:
- 处理后的字符串
-
replaceSEWith
替换特定字符串开头、结尾的字符串 如 _____a_a_a_a_____ 传入 _, c 等于 c____a_a_a_a____c- 参数:
str- 待处理字符串suffix- 替换匹配内容replace- 替换的内容- 返回:
- 处理后的字符串
-
replaceStartsWith
替换开头字符串- 参数:
str- 待处理字符串prefix- 开头匹配字符串- 返回:
- 处理后的字符串
-
replaceStartsWith
替换开头字符串- 参数:
str- 待处理字符串prefix- 开头匹配字符串startAppend- 开头追加的内容- 返回:
- 处理后的字符串
-
replaceEndsWith
替换结尾字符串- 参数:
str- 待处理字符串suffix- 结尾匹配字符串- 返回:
- 处理后的字符串
-
replaceEndsWith
替换结尾字符串- 参数:
str- 待处理字符串suffix- 结尾匹配字符串replace- 替换的内容- 返回:
- 处理后的字符串
-
clearSEWiths
清空特定字符串开头、结尾的字符串 如 _____a_a_a_a_____ 传入 _ 等于 a_a_a_a- 参数:
str- 待处理字符串suffix- 匹配判断字符串- 返回:
- 处理后的字符串
-
clearStartsWith
清空特定字符串开头的字符串 如 _____a_a_a_a_____ 传入 _ 等于 a_a_a_a_____- 参数:
str- 待处理字符串suffix- 匹配判断字符串- 返回:
- 处理后的字符串
-
clearEndsWith
清空特定字符串结尾的字符串 如 _____a_a_a_a_____ 传入 _ 等于 _____a_a_a_a- 参数:
str- 待处理字符串suffix- 匹配判断字符串- 返回:
- 处理后的字符串
-
replaceAll
替换字符串- 参数:
str- 待处理字符串suffix- 匹配判断字符串replace- 替换的内容- 返回:
- 处理后的字符串
-
replaceAllToNull
替换字符串- 参数:
str- 待处理字符串suffix- 匹配判断字符串replace- 替换的内容- 返回:
- 处理后的字符串, 替换失败则返回 null
-
replaceAlls
替换字符串- 参数:
str- 待处理字符串suffixArrays- 匹配判断字符串数组replaceArrays- 准备替换的字符串数组- 返回:
- 处理后的字符串
-
split
拆分字符串- 参数:
str- 待处理字符串regex- 正则表达式- 返回:
- 拆分后的数组
-
split
拆分字符串获取指定索引- 参数:
str- 待处理字符串regex- 正则表达式index- 索引- 返回:
- 拆分后的数组
-
split
拆分字符串获取指定索引- 参数:
str- 待处理字符串regex- 正则表达式index- 索引defaultStr- 默认字符串- 返回:
- 拆分后的数组
-