public final class Strings extends Object
| 构造器和说明 |
|---|
Strings() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
containsAny(String str,
List<String> searches) |
static int |
count(String text,
String str)
Count str occur on text.
|
static boolean |
isMatch(String s,
String p)
'?'
|
static String |
toCamelcaseName(String separatedName,
char separator)
带分隔符名字转驼峰,如下划线转换为驼峰:aseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, underscoreName);
1 LOWER_HYPHEN 连字符的变量命名规范如lower-hyphen
2 LOWER_UNDERSCORE c++变量命名规范如lower_underscore
3 LOWER_CAMEL java变量命名规范如lowerCamel
4 UPPER_CAMEL java和c++类的命名规范如UpperCamel
5 UPPER_UNDERSCORE java和c++常量的命名规范如UPPER_UNDERSCORE
|
static String |
toSeparatedName(String camelcaseName,
char separator)
驼峰转为带分隔符名字,如驼峰转换为下划线:CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, camelCaseName);
|
public static boolean isMatch(String s, String p)
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
isMatch("aa","a") = false
isMatch("aa","aa") = true
isMatch("aaa","aa") = false
isMatch("aa", "*") = true
isMatch("aa", "a*") = true
isMatch("ab", "?*") = true
isMatch("aab", "c*a*b") = false
s - the textp - the wildcard patterntrue if the string match patternpublic static int count(String text, String str)
text - the textstr - the stringpublic static String toSeparatedName(String camelcaseName, char separator)
camelcaseName - the camelcase nameseparator - the separatorCaseFormat.to(CaseFormat, String)public static String toCamelcaseName(String separatedName, char separator)
separatedName - the separated nameseparator - the separatorCaseFormat.to(CaseFormat, String)Copyright © 2023. All rights reserved.