A {@link CharPredicate} that returns true if the character is equal to any character in
{@code chars}.
507426
public static CharPredicate among(final String chars) {
    return new CharPredicate() {
      @Override public boolean isChar(char c) {
        return chars.indexOf(c) >= 0;
      }
      @Override public String toString() {
        return '[' + chars + ']';
      }
    };
  }
593699
private boolean find(Clause clause, char[] chars, int[] cursor) {
    int start = cursor[0];
    int end = cursor[1];
    while (end - start >= clause.minlen)
      if (matchClause(clause, chars, cursor))
        return true;
      else
        cursor[0] = ++start;
    return false;
  }
820835
public boolean contentEquals(CharSequence x) {
        if (x == this) return true;
        if (isEmpty()) return x.length() == 0;
        int sz = size(), sz2 = x.length();
        if (sz != sz2) return false;
        for (int i = 0; i < sz; ++i) {
            char c = buf[toInternalId(i)];
            char c1 = x.charAt(i);
            if (c != c1) return false;
        }
        return true;
    }
738732
static public boolean canRepresent(CharSequence str0) {
        if (str0 == null) {
            return true;
        }

        int len = str0.length();
        for (int i = 0; i < len; i++) {
            // get the char in this string
            char c = str0.charAt(i);
            // simple range checks for most common characters (0x20 -> 0x5F) or (0x61 -> 0x7E)
            if ((c >= ' ' && c <= '_') || (c >= 'a' && c <= '~')) {
                continue;
            } else {
                // 10X more efficient using a switch statement vs. a lookup table search
                switch (c) {
                    case '\u00A3':	// £
                    case '\u00A5':	// ¥
                    case '\u00E8':	// è
                    case '\u00E9':	// é
                    case '\u00F9':	// ù
                    case '\u00EC':	// ì
                    case '\u00F2':	// ò
                    case '\u00C7':	// Ç
                    case '\n':          // newline
                    case '\u00D8':	// Ø
                    case '\u00F8':	// ø
                    case '\r':          // carriage return
                    case '\u000c':      // form feed
                    case '\u00C5':	// Å
                    case '\u00E5':	// å
                    case '\u0394':	// Δ
                    case '\u03A6':	// Φ
                    case '\u0393':	// Γ
                    case '\u039B':	// Λ
                    case '\u03A9':	// Ω
                    case '\u03A0':	// Π
                    case '\u03A8':	// Ψ
                    case '\u03A3':	// Σ
                    case '\u0398':	// Θ
                    case '\u039E':	// Ξ
                    case '\u00C6':	// Æ
                    case '\u00E6':	// æ
                    case '\u00DF':	// ß
                    case '\u00C9':	// É
                    case '\u00A4':	// ¤
                    case '\u00A1':	// ¡
                    case '\u00C4':	// Ä
                    case '\u00D6':	// Ö
                    case '\u00D1':	// Ñ
                    case '\u00DC':	// Ü
                    case '\u00A7':	// §
                    case '\u00BF':	// ¿
                    case '\u00E4':	// ä
                    case '\u00F6':	// ö
                    case '\u00F1':	// ñ
                    case '\u00FC':	// ü
                    case '\u00E0':	// à
                    case '\u20AC':	// €
                        continue;
                    default:
                        return false;
                }
            }
        }
        return true;
    }
293037
public static boolean containsIgnoreCase(CharSequence a, CharSequence b) {
        return contains(a, b, AsciiCaseInsensitiveCharEqualityComparator.INSTANCE);
    }
480881
public final boolean contains(char c1, char c2) {
    try {
      String s = new String(new String(new char[]{c1, c2}).getBytes(enc), enc);
      return s.length() == 2 && s.charAt(0) == c1 && s.charAt(1) == c2;
    }
    catch (UnsupportedEncodingException e) {
      return false;
    }
    // work around gcj bug (libgcj/9802)
    catch (RuntimeException e) {
      return false;
    }
  }
692843
public static boolean isJavaLangType(String s) {
		return getJavaDefaultTypes().contains(s) && Character.isUpperCase(s.charAt(0));
	}
800545
static boolean containsNoDigit(final String s) {
    for (int k = 0; k < s.length(); k++) {
      if (Character.isDigit(s.charAt(k))) {
        return false;
      }
    }
    return true;
  }
797334
def match(self, chars):
        """"""
        start_index = self.next_index
        for char in self:
            if char not in chars:
                self.next_index -= 1
                break
        return self[start_index:self.next_index]
1262155
public static boolean isAlphaNumeric(String in) {
		char c = 0;
		for (int i = in.length(); i > 0; i--) {
			c = in.charAt(i - 1);
			if (!Character.isLetterOrDigit(c)) {
				return false;
			}
		}
		return true;
	}
1311882
public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone)
    {
        Character result = StringIterate.detectChar(string, predicate);
        return result == null ? Character.valueOf(resultIfNone.charAt(0)) : result;
    }
9271
public boolean containsAll(CharSequence str) {
    final int n = str.length();
    for (int i = 0; i < n; ++i) {
      if (!contains(str.charAt(i))) {
        return false;
      }
    }
    return true;
  }
290238
def match_any_char(self, chars, offset=0):
        """"""
        if not self.has_space(offset=offset):
            return ''
        current = self.string[self.pos + offset]
        return current if current in chars else ''
942757
@Deprecated
    public static Character detect(String string, CharPredicate predicate)
    {
        return StringIterate.detectChar(string, predicate);
    }
85091
@Deprecated
    public static boolean onCharacterBoundary(CharSequence s, int i) {
        return i <= 0 
        || i >= s.length() 
        || !Character.isHighSurrogate(s.charAt(i-1))
        || !Character.isLowSurrogate(s.charAt(i));
    }
903993
public static CharPredicate and(final CharPredicate predicate1, final CharPredicate predicate2) {
    return new CharPredicate() {
      @Override public boolean isChar(char c) {
        return predicate1.isChar(c) && predicate2.isChar(c);
      }
      @Override public String toString() {
        return predicate1 + " and " + predicate2;
      }
    };
  }
888883
@Deprecated
    public static int count(String string, final com.gs.collections.impl.block.predicate.primitive.CharPredicate predicate)
    {
        return StringIterate.countChar(string, new CharPredicate()
        {
            public boolean accept(char value)
            {
                return predicate.accept(value);
            }
        });
    }