Keep only letters from a list of characters.
@param characters to filter
@return only letters
515768
public static List<Character> filterLetters(List<Character> characters) {
        return characters.stream().filter(Character::isLetter).collect(toList());
    }
29082
public static char pickChar(String values) {
		if (values == null || values.length() == 0)
			return '\0';

		int index = RandomInteger.nextInteger(values.length());
		return values.charAt(index);
	}
361100
public static void toLowerCase(StringValue string) {
		final char[] chars = string.getCharArray();
		final int len = string.length();

		for (int i = 0; i < len; i++) {
			chars[i] = Character.toLowerCase(chars[i]);
		}
	}
979871
public void characters(String characters) throws SAXException
    {
        final int len = characters.length();
        if (len > m_charsBuff.length)
        {
           m_charsBuff = new char[len*2 + 1];             
        }
        characters.getChars(0,len, m_charsBuff, 0);   
        characters(m_charsBuff, 0, len);
    }
1292451
@SuppressWarnings("unchecked")
    public static List<Character> getAt(char[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
111600
public static List<String> splitJavaIdentifier(String string) {
        assert string != null;
        List<String> result = new ArrayList<String>();

        int startIndex = 0;
        while (startIndex < string.length()) {
            if (Character.isLowerCase(string.charAt(startIndex))) {
                int i = startIndex;
                while (i < string.length() && Character.isLowerCase(string.charAt(i))) {
                    i++;
                }
                result.add(string.substring(startIndex, i));
                startIndex = i;
            } else if (Character.isUpperCase(string.charAt(startIndex))) {
                if (string.length() - startIndex == 1) {
                    result.add(Character.toString(string.charAt(startIndex++)));
                } else if (Character.isLowerCase(string.charAt(startIndex + 1))) {
                    int i = startIndex + 1;
                    while (i < string.length() && Character.isLowerCase(string.charAt(i))) {
                        i++;
                    }
                    result.add(string.substring(startIndex, i));
                    startIndex = i;
                } else { // if there's several uppercase letters in row
                    int i = startIndex + 1;
                    while (i < string.length() && Character.isUpperCase(string.charAt(i))
                            && (string.length()-i == 1 || Character.isUpperCase(string.charAt(i+1)))) {
                        i++;
                    }
                    result.add(string.substring(startIndex, i));
                    startIndex = i;
                }
            }else {
                result.add(Character.toString(string.charAt(startIndex++)));
            }
        }
        return result;
    }
216338
public static int search(CharSequence chars, char c) {
        int count = 0;
        for (int i = 0; i < chars.length(); i++) {
            if (chars.charAt(i) == c) {
                count++;
            }
        }
        return count;
    }
1151199
static CharInput asCharInput(final CharSequence chars) {
    checkNotNull(chars);
    return new CharInput() {
      int index = 0;

      @Override
      public int read() {
        if (index < chars.length()) {
          return chars.charAt(index++);
        } else {
          return -1;
        }
      }

      @Override
      public void close() {
        index = chars.length();
      }
    };
  }
226924
public static StrMatcher charSetMatcher(final char... chars) {
        if (chars == null || chars.length == 0) {
            return NONE_MATCHER;
        }
        if (chars.length == 1) {
            return new CharMatcher(chars[0]);
        }
        return new CharSetMatcher(chars);
    }
1300140
public static List<Character> collectPrintableCharactersOf(Charset charset) {
        List<Character> chars = new ArrayList<>();
        for (int i = Character.MIN_VALUE; i < Character.MAX_VALUE; i++) {
            char character = (char) i;
            if (isPrintable(character)) {
                String characterAsString = Character.toString(character);
                byte[] encoded = characterAsString.getBytes(charset);
                String decoded = new String(encoded, charset);
                if (characterAsString.equals(decoded)) {
                    chars.add(character);
                }
            }
        }
        return chars;
    }
248836
public void characters(char[] characters, int offset, int length)
        throws SAXException
    {
        if (m_firstTagNotEmitted)
        {
            flush();
        }

        m_handler.characters(characters, offset, length);

    }
1189541
@Override
    public void characters(char ch[], int start, int length) {
	content.append(new String(ch, start, length));
    }
460197
public static String keepSeqUnique(final String keys) {
    String[] keysArray = split(keys, ",");
    List<String> keyList = CollectUtils.newArrayList();
    for (int i = 0; i < keysArray.length; i++) {
      if (!keyList.contains(keysArray[i])) {
        keyList.add(keysArray[i]);
      }
    }
    StringBuilder keyBuf = new StringBuilder();
    for (Iterator<String> iter = keyList.iterator(); iter.hasNext();) {
      keyBuf.append(iter.next());
      if (iter.hasNext()) {
        keyBuf.append(",");
      }
    }
    return keyBuf.toString();
  }
234929
public static Iterator<Character> notExistChars(String s) {
    return new Iterator<Character>() {
      IntList collect = IntList.create(s.chars().distinct().sorted().toArray());
      int current = 128;
      Character next = null;

      @Override
      public Character next() {
        if (calcNext()) {
          Character c = next;
          next = null;
          return c;
        } else {
          throw new NoSuchElementException("No next non-exist character.");
        }
      }

      @Override
      public boolean hasNext() {
        return calcNext();
      }

      private boolean calcNext() {
        if (next == null) {
          while (++current < Integer.MAX_VALUE) {
            if (collect.remove(current) == false) {
              next = (char) current;
              return true;
            }
          }
          return false;
        }
        return true;
      }
    };
  }
43254
private CharBuffer filter(char []array)
  {
    CharBuffer buf = new CharBuffer();
    CharBuffer fun = new CharBuffer();
    CharBuffer file = new CharBuffer();

    int i = 0;
    while (i < array.length) {
      fun.clear();
      file.clear();
      int start = i;
      int end;
      for (end = i; end < array.length && array[end] != '\n'; end++) {
      }

      for (; i < end && Character.isWhitespace(array[i]); i++) {
        fun.append(array[i]);
      }

      // skip 'at'
      for (; i < end && ! Character.isWhitespace(array[i]); i++) {
        fun.append(array[i]);
      }

      if (! fun.endsWith("at")) {
        for (i = start; i < end; i++) {
          buf.append(array[i]);
        }
        i = end + 1;

        buf.append('\n');

        continue;
      }

      for (; i < end && Character.isWhitespace(array[i]); i++) {
      }

      fun.clear();
      for (; i < end && ! Character.isWhitespace(array[i]) &&
             array[i] != '('; i++) {
        fun.append(array[i]);
      }

      if (i < end && array[i] == '(')
        i++;

      for (; i < end && ! Character.isWhitespace(array[i]) &&
             array[i] != ':' && array[i] != ')'; i++) {
        file.append(array[i]);
      }
      
      int line = -1;
      if (i < end && array[i] == ':') {
        line = 0;
        for (i++; i < end && array[i] >= '0' && array[i] <= '9'; i++) {
          line = 10 * line + array[i] - '0';
        }
      }

      for (; i < end && ! Character.isWhitespace(array[i]) &&
             array[i] != ':' && array[i] != ')'; i++) {
        file.append(array[i]);
      }

      buf.append("\tat ");
      buf.append(fun);
      buf.append("(");
      String dstFile = file.toString();

      if (dstFile.equals(_dstFilename)) {
        convertError(buf, line);
      }
      else {
        buf.append(file);
        if (line > 0) {
          buf.append(":");
          buf.append(line);
        }
      }
      buf.append(array, i, end - i);
      buf.append('\n');
      i = end + 1;
    }

    return buf;
  }
522066
public static int indexFrom(String s,String chars)
    {
        for (int i=0;i<s.length();i++)
           if (chars.indexOf(s.charAt(i))>=0)
              return i;
        return -1;
    }
926438
def _ending_consonants_only(self, letters: List[str]) -> List[int]:
        """"""
        reversed_letters = list(reversed(letters))
        length = len(letters)
        for idx, letter in enumerate(reversed_letters):
            if not self._contains_vowels(letter) and self._contains_consonants(letter):
                return [(length - idx) - 1]
            if self._contains_vowels(letter):
                return []
            if self._contains_vowels(letter) and self._contains_consonants(letter):
                return []
        return []