本文整理了Java中java.lang.Character.isSpace()
方法的一些代码示例,展示了Character.isSpace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.isSpace()
方法的具体详情如下:
包路径:java.lang.Character
类名称:Character
方法名:isSpace
[英]Use #isWhitespace(char) instead.
[中]
代码示例来源:origin: org.postgresql/postgresql
private static int skipWhitespace(char[] s, int start) {
int slen = s.length;
for (int i = start; i < slen; i++) {
if (!Character.isSpace(s[i])) {
return i;
}
}
return slen;
}
代码示例来源:origin: postgresql/postgresql
private static int skipWhitespace(char []s, int start)
{
int slen = s.length;
for (int i=start; i<slen; i++) {
if (!Character.isSpace(s[i]))
return i;
}
return slen;
}
代码示例来源:origin: libgdx/libgdx
if (Character.isSpace(nextChar)) {
if (mode == CONTINUE) {
mode = IGNORE;
代码示例来源:origin: libgdx/libgdx
if (Character.isSpace(nextChar)) {
if (mode == CONTINUE) {
mode = IGNORE;
代码示例来源:origin: libgdx/libgdx
while (Character.isSpace(data[p]))
p--;
代码示例来源:origin: libgdx/libgdx
while (Character.isSpace(data[p]))
p--;
代码示例来源:origin: robovm/robovm
} else if ('0' <= next && next <= '9') {
nextState = NUMBERS;
} else if (!Character.isSpace(next) && ",+-:/".indexOf(next) == -1) {
throw parseError(string);
&& (Character.isSpace(next) || next == ','
|| next == '/' || next == '\r')) {
year = digit;
throw parseError(string);
} else if (Character.isSpace(next) || next == ','
|| next == '-' || next == '\r') {
if (hour != -1 && minute == -1) {
} else if (!Character.isSpace(next) && next != ','
&& nextState != NUMBERS) {
sign = 0;
代码示例来源:origin: larsga/Duke
private void recompute() {
charweight = new double[0xFF];
for (int ix = 0; ix < charweight.length; ix++) {
char ch = (char) ix;
double weight = other;
if (Character.isLetter(ch))
weight = letters;
else if (Character.isDigit(ch))
weight = digits;
else {
int type = Character.getType(ch);
// 20, 21, 22, 23, 24, 25, 26, 27
if (Character.isSpace(ch) ||
(type >= 20 && type <= 27))
weight = punctuation;
}
charweight[ix] = weight;
}
}
}
代码示例来源:origin: org.ancoron.postgresql/org.postgresql
private static int skipWhitespace(char []s, int start)
{
int slen = s.length;
for (int i=start; i<slen; i++) {
if (!Character.isSpace(s[i]))
return i;
}
return slen;
}
代码示例来源:origin: org.ancoron.postgresql/org.postgresql.osgi
private static int skipWhitespace(char []s, int start)
{
int slen = s.length;
for (int i=start; i<slen; i++) {
if (!Character.isSpace(s[i]))
return i;
}
return slen;
}
代码示例来源:origin: org.w3c.jigsaw/jigsaw
/**
* Predicate function for checking if a chahracter can belong to an atom.
*
* @param first if true means that c is the first character of the atom
*/
protected boolean isAtomChar(char c, boolean first)
{
return !(Character.isSpace(c)
|| c == '(' || c == ')' || c == '"' || c == '}' || c == '{');
}
代码示例来源:origin: stackoverflow.com
String str1 = " abc ";
char[] cs = str1.toCharArray();
Character[] characters = ArrayUtils.toObject(cs);
// System.out.println(characters.length); // 6
for (Character character : characters) {
if (character.isSpace(character.charValue())) {
// PROCESS ACCORDINGLY
} else {
// PROCESS ACCORDINGLY
}
}
代码示例来源:origin: org.dashbuilder/dashbuilder-dataset-api
public static boolean isBlank(String str) {
int strLen;
if (str == null || (strLen = str.length()) == 0) {
return true;
}
for (int i = 0; i < strLen; i++) {
if (!Character.isSpace(str.charAt(i))) {
return false;
}
}
return true;
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
int nextNonWhitespace() {
while (true) {
final int c = next();
if (!Character.isSpace((char) c)) {
return c;
}
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-elemental
int nextNonWhitespace() {
while (true) {
final int c = next();
if (!Character.isSpace((char) c)) {
return c;
}
}
}
代码示例来源:origin: pl.edu.icm.sedno/sedno-additions
@Override
public double calculateFeatureValue(Token object, Record context) {
String text = object.getText();
for (int i = 0; i < text.length(); i++) {
if (!Character.isSpace(text.charAt(i))) {
return 0;
}
}
countPositive++;
return 1;
}
代码示例来源:origin: google/closure-stylesheets
/**
* Raises an IOException if there are any non-space characters on in, and consumes the remaining
* characters on in.
*/
private static void requireEndOfInput(BufferedReader in) throws IOException {
for (int ch; (ch = in.read()) >= 0; ) {
if (!Character.isSpace((char) ch)) {
throw new IOException("Expected end of input, not '" + escape((char) ch) + "'");
}
}
}
代码示例来源:origin: facebook/TextLayoutBuilder
if (Character.isSpace(text.charAt(newEnd - 1))) {
--newEnd;
} else {
代码示例来源:origin: bedatadriven/activityinfo
int nextNonWhitespace() {
while (true) {
final int c = next();
if (!Character.isSpace((char) c)) {
return c;
}
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-elemental
String nextUntilOneOf(String chars) {
final StringBuilder buffer = new StringBuilder();
int c = next();
while (c != INVALID_CHAR) {
if (Character.isSpace((char) c) || chars.indexOf((char) c) >= 0) {
back(c);
break;
}
buffer.append((char) c);
c = next();
}
return buffer.toString();
}
内容来源于网络,如有侵权,请联系作者删除!