Search code examples
javaopen-sourcenlp

Is there any Java library to provide list of ASCII special characters?


Is there any Java library to provide list of ASCII special characters?

Example:

[SPACE]   {END}  -  /  |  \  ;  :  ::  #  *  &  ( 
)  >  <  [  ]  {  }  ?  !  ‘  “  

Solution

  • You could create the list on your own

    List<Character> specialChars = new ArrayList<Character>();
    for(char code = 0; code < 256; code++) {
        if(!Character.isLetterOrDigit(code)) {
            specialChars.add(new Character(code));
        }
    }