本文整理了Java中java.lang.Character.isLowerCase()
方法的一些代码示例,展示了Character.isLowerCase()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.isLowerCase()
方法的具体详情如下:
包路径:java.lang.Character
类名称:Character
方法名:isLowerCase
[英]Indicates whether the specified character is a lower case letter.
[中]指示指定的字符是否为小写字母。
代码示例来源:origin: google/guava
@Override
public boolean matches(char c) {
return Character.isLowerCase(c);
}
代码示例来源:origin: prestodb/presto
@Override
public boolean matches(char c) {
return Character.isLowerCase(c);
}
代码示例来源:origin: google/j2objc
@Override
public boolean matches(char c) {
return Character.isLowerCase(c);
}
代码示例来源:origin: stanfordnlp/CoreNLP
private static String convertToEl(String l) {
if(Character.isLowerCase(l.charAt(0)))
return "e" + l;
else
return "E" + l;
}
代码示例来源:origin: apache/incubator-dubbo
private static String propertyName(String pn) {
return pn.length() == 1 || Character.isLowerCase(pn.charAt(1)) ? Character.toLowerCase(pn.charAt(0)) + pn.substring(1) : pn;
}
代码示例来源:origin: apache/incubator-dubbo
private static String propertyName(String pn) {
return pn.length() == 1 || Character.isLowerCase(pn.charAt(1)) ? Character.toLowerCase(pn.charAt(0)) + pn.substring(1) : pn;
}
代码示例来源:origin: baomidou/mybatis-plus
public static boolean containsLowerCase(String s) {
for (char c : s.toCharArray()) {
if (Character.isLowerCase(c)) {
return true;
}
}
return false;
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* A string is lowercase if it starts with a lowercase letter
* such as one from a to z.
* Should we include numbers?
* @param s The String to check
* @return If its first character is lower case
*/
protected static boolean startsLowerCase(String s) {
if (s == null) {
return false;
}
char ch = s.charAt(0);
return Character.isLowerCase(ch);
}
代码示例来源:origin: log4j/log4j
public static String capitalize(String name) {
if (Character.isLowerCase(name.charAt(0))) {
if (name.length() == 1 || Character.isLowerCase(name.charAt(1))) {
StringBuffer newname = new StringBuffer(name);
newname.setCharAt(0, Character.toUpperCase(name.charAt(0)));
return newname.toString();
}
}
return name;
}
代码示例来源:origin: stanfordnlp/CoreNLP
private static boolean isUpperCase(String s) {
for (int i = 0; i < s.length(); i++) {
if (Character.isLowerCase(s.charAt(i)))
return false;
}
return true;
}
代码示例来源:origin: stanfordnlp/CoreNLP
static boolean noneLowerCase(String s) {
if (s == null) {
return false;
}
for (int i = 0, len = s.length(); i < len; i++) {
if (Character.isLowerCase(s.charAt(i))) {
return false;
}
}
return true;
}
代码示例来源:origin: spring-projects/spring-framework
@Nullable
private String maybeExtractVariableName(@Nullable String candidateToken) {
if (!StringUtils.hasLength(candidateToken)) {
return null;
}
if (Character.isJavaIdentifierStart(candidateToken.charAt(0)) &&
Character.isLowerCase(candidateToken.charAt(0))) {
char[] tokenChars = candidateToken.toCharArray();
for (char tokenChar : tokenChars) {
if (!Character.isJavaIdentifierPart(tokenChar)) {
return null;
}
}
return candidateToken;
}
else {
return null;
}
}
代码示例来源:origin: shuzheng/zheng
/**
* 首字母转小写
* @param s
* @return
*/
public static String toLowerCaseFirstOne(String s) {
if (StringUtils.isBlank(s)) {
return s;
}
if (Character.isLowerCase(s.charAt(0))) {
return s;
} else {
return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString();
}
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* Uppercases the first character of a string.
*
* @param s a string to capitalize
* @return a capitalized version of the string
*/
public static String capitalize(String s) {
if (Character.isLowerCase(s.charAt(0))) {
return Character.toUpperCase(s.charAt(0)) + s.substring(1);
} else {
return s;
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
private static boolean checkPrefix(@Nullable String name, @NotNull String prefix) {
// https://github.com/golang/go/blob/master/src/cmd/go/test.go#L1161 – isTest()
if (name == null || !name.startsWith(prefix)) return false;
if (prefix.length() == name.length()) return true;
char c = name.charAt(prefix.length());
return !Character.isLetter(c) || !Character.isLowerCase(c);
}
}
代码示例来源:origin: netty/netty
public static String toPoolName(Class<?> poolType) {
if (poolType == null) {
throw new NullPointerException("poolType");
}
String poolName = StringUtil.simpleClassName(poolType);
switch (poolName.length()) {
case 0:
return "unknown";
case 1:
return poolName.toLowerCase(Locale.US);
default:
if (Character.isUpperCase(poolName.charAt(0)) && Character.isLowerCase(poolName.charAt(1))) {
return Character.toLowerCase(poolName.charAt(0)) + poolName.substring(1);
} else {
return poolName;
}
}
}
代码示例来源:origin: joelittlejohn/jsonschema2pojo
private boolean areAllWordsUpperCaseBesideDelimiters(String words, char... delimiters) {
char[] wordChars = words.toCharArray();
for (char c : wordChars) {
if (!containsAny("" + c, delimiters) && Character.isLowerCase(c)) {
return false;
}
}
return true;
}
代码示例来源:origin: checkstyle/checkstyle
private static String makeFirstUpper(String str) {
final char ch = str.charAt(0);
final String result;
if (Character.isLowerCase(ch)) {
result = Character.toUpperCase(ch) + str.substring(1);
}
else {
result = str;
}
return result;
}
代码示例来源:origin: org.assertj/assertj-core
/**
* Asserts that the actual value is a lowercase character.
* @param info contains information about the assertion.
* @param actual the actual value.
* @throws AssertionError if the actual value is {@code null}.
* @throws AssertionError if the actual value is not a lowercase character.
*/
public void assertLowerCase(AssertionInfo info, Character actual) {
assertNotNull(info, actual);
if (isLowerCase(actual)) return;
throw failures.failure(info, shouldBeLowerCase(actual));
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
// TODO possible optimization here if we cache the discovered type reference, but can we do that?
String typeName = (String) this.children[0].getValueInternal(state).getValue();
Assert.state(typeName != null, "No type name");
if (!typeName.contains(".") && Character.isLowerCase(typeName.charAt(0))) {
TypeCode tc = TypeCode.valueOf(typeName.toUpperCase());
if (tc != TypeCode.OBJECT) {
// It is a primitive type
Class<?> clazz = makeArrayIfNecessary(tc.getType());
this.exitTypeDescriptor = "Ljava/lang/Class";
this.type = clazz;
return new TypedValue(clazz);
}
}
Class<?> clazz = state.findType(typeName);
clazz = makeArrayIfNecessary(clazz);
this.exitTypeDescriptor = "Ljava/lang/Class";
this.type = clazz;
return new TypedValue(clazz);
}
内容来源于网络,如有侵权,请联系作者删除!