java.lang.Character.isTitleCase()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中java.lang.Character.isTitleCase()方法的一些代码示例,展示了Character.isTitleCase()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.isTitleCase()方法的具体详情如下:
包路径:java.lang.Character
类名称:Character
方法名:isTitleCase

Character.isTitleCase介绍

[英]Indicates whether the specified character is a titlecase character.
[中]指示指定的字符是否为滴定酶字符。

代码示例

代码示例来源:origin: konsoletyper/teavm

@Override
  public boolean contains(int ch) {
    return Character.isTitleCase(ch);
  }
};

代码示例来源:origin: facebook/stetho

private static String capitalize(String str) {
 if (str == null || str.length() == 0 || Character.isTitleCase(str.charAt(0))) {
  return str;
 }
 StringBuilder buffer = new StringBuilder(str);
 buffer.setCharAt(0, Character.toTitleCase(buffer.charAt(0)));
 return buffer.toString();
}

代码示例来源:origin: stanfordnlp/CoreNLP

private static boolean isNameCase(String str) {
 if (str.length() < 2) {
  return false;
 }
 if (!(Character.isUpperCase(str.charAt(0)) || Character.isTitleCase(str.charAt(0)))) {
  return false;
 }
 for (int i = 1; i < str.length(); i++) {
  if (Character.isUpperCase(str.charAt(i))) {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: robovm/robovm

/**
 * True if 'index' is preceded by a sequence consisting of a cased letter and a case-ignorable
 * sequence, and 'index' is not followed by a sequence consisting of an ignorable sequence and
 * then a cased letter.
 */
private static boolean isFinalSigma(char[] value, int offset, int count, int index) {
  // TODO: we don't skip case-ignorable sequences like we should.
  // TODO: we should add a more direct way to test for a cased letter.
  if (index <= offset) {
    return false;
  }
  char previous = value[index - 1];
  if (!(Character.isLowerCase(previous) || Character.isUpperCase(previous) || Character.isTitleCase(previous))) {
    return false;
  }
  if (index + 1 >= offset + count) {
    return true;
  }
  char next = value[index + 1];
  if (Character.isLowerCase(next) || Character.isUpperCase(next) || Character.isTitleCase(next)) {
    return false;
  }
  return true;
}

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Signature for a specific word; loc parameter is ignored.
 * @param word The word
 * @param loc Its sentence position
 * @return A "signature" (which represents an equivalence class of Strings), e.g., a suffix of the string
 */
@Override
public String getSignature(String word, int loc) {
 StringBuilder subStr = new StringBuilder("UNK-");
 int n = word.length() - 1;
 char first = word.charAt(0);
 if (useFirstCap) {
  if (Character.isUpperCase(first) || Character.isTitleCase(first)) {
   subStr.append('C');
  } else {
   subStr.append('c');
  }
 }
 if (useFirst) {
  subStr.append(first);
 }
 if (useEnd) {
  subStr.append(word.substring(n - endLength > 0 ? n - endLength : 0, n));
 }
 return subStr.toString();
}

代码示例来源:origin: baomidou/mybatis-plus

/**
 * 拼接字符串第二个字符串第一个字母大写
 */
public static String concatCapitalize(String concatStr, final String str) {
  if (isEmpty(concatStr)) {
    concatStr = EMPTY;
  }
  if (str == null || str.length() == 0) {
    return str;
  }
  final char firstChar = str.charAt(0);
  if (Character.isTitleCase(firstChar)) {
    // already capitalized
    return str;
  }
  return concatStr + Character.toTitleCase(firstChar) + str.substring(1);
}

代码示例来源:origin: org.apache.commons/commons-lang3

buffer[i] = Character.toLowerCase(ch);
  whitespace = false;
} else if (Character.isTitleCase(ch)) {
  buffer[i] = Character.toLowerCase(ch);
  whitespace = false;

代码示例来源:origin: org.apache.commons/commons-lang3

if (Character.isUpperCase(oldCodepoint)) {
  newCodePoint = Character.toLowerCase(oldCodepoint);
} else if (Character.isTitleCase(oldCodepoint)) {
  newCodePoint = Character.toLowerCase(oldCodepoint);
} else if (Character.isLowerCase(oldCodepoint)) {

代码示例来源:origin: commons-lang/commons-lang

if (Character.isUpperCase(ch)) {
  tmp = Character.toLowerCase(ch);
} else if (Character.isTitleCase(ch)) {
  tmp = Character.toLowerCase(ch);
} else if (Character.isLowerCase(ch)) {

代码示例来源:origin: stanfordnlp/CoreNLP

} else if (Character.isLowerCase(c)) {
 m = 'x';
} else if (Character.isUpperCase(c) || Character.isTitleCase(c)) {
 m = 'X';

代码示例来源:origin: stanfordnlp/CoreNLP

} else if (Character.isLowerCase(c)) {
 return 'x';
} else if (Character.isUpperCase(c) || Character.isTitleCase(c)) {
 return 'X';
} else if (Character.isWhitespace(c) || Character.isSpaceChar(c)) {

代码示例来源:origin: stanfordnlp/CoreNLP

char ch = word.charAt(i);
char newClass;
if (Character.isUpperCase(ch) || Character.isTitleCase(ch)) {
 if (loc == 0) {
  newClass = 'S';

代码示例来源:origin: stanfordnlp/CoreNLP

hasNonDigit = true;
 if (Character.isLetter(ch)) {
  if (Character.isLowerCase(ch) || Character.isTitleCase(ch)) {
   hasLower = true;
   && (Character.isUpperCase(word.charAt(0)) || Character.isTitleCase(word.charAt(0)))) {
if (!hasLower) {
 sb.append("-ALLC");

代码示例来源:origin: stanfordnlp/CoreNLP

hasNonDigit = true;
if (Character.isLetter(ch)) {
 if (Character.isLowerCase(ch) || Character.isTitleCase(ch)) {
  hasLower = true;
 } else {

代码示例来源:origin: looly/hutool

if (Character.isUpperCase(ch)) {
  buffer[i] = Character.toLowerCase(ch);
} else if (Character.isTitleCase(ch)) {
  buffer[i] = Character.toLowerCase(ch);
} else if (Character.isLowerCase(ch)) {

代码示例来源:origin: looly/hutool

if (Character.isUpperCase(ch)) {
  buffer[i] = Character.toLowerCase(ch);
} else if (Character.isTitleCase(ch)) {
  buffer[i] = Character.toLowerCase(ch);
} else if (Character.isLowerCase(ch)) {

代码示例来源:origin: stanfordnlp/CoreNLP

if (Character.isLetter(ch)) {
   hasLetter = true;
   if (Character.isLowerCase(ch) || Character.isTitleCase(ch)) {
    hasLower = true;
if (Character.isUpperCase(word.charAt(0)) || Character.isTitleCase(word.charAt(0))) {
 if (!hasLower) {
  sb.append("-AC");

代码示例来源:origin: commons-lang/commons-lang

if (Character.isUpperCase(ch)) {
  ch = Character.toLowerCase(ch);
} else if (Character.isTitleCase(ch)) {
  ch = Character.toLowerCase(ch);
} else if (Character.isLowerCase(ch)) {

代码示例来源:origin: stanfordnlp/CoreNLP

if ((Character.isUpperCase(first) || Character.isTitleCase(first)) && !isUpperCase(word)) {
 sb.append("-C");
} else {

代码示例来源:origin: jphp-group/jphp

@FastMethod
@Signature(@Arg("char"))
public static Memory isTitle(Environment env, Memory... args) {
  return Character.isTitleCase(chr(args[0])) ? Memory.TRUE : Memory.FALSE;
}

相关文章

Character类方法