code: public static boolean isSymbol(char ch) {
      switch (Character.getType(ch)) {
        case Character.MATH_SYMBOL:
        case Character.CURRENCY_SYMBOL:
        case Character.MODIFIER_SYMBOL:
        case Character.OTHER_SYMBOL:
          return true;
          
        default:
          return false;
      }
    }
docs: Returns true if the character is in any of the symbol categories.