public static boolean allAscii(String s){
  int len=s.length();
  for (int i=0; i < len; ++i) {
    if ((s.charAt(i) & 0xff80) != 0) {
      return false;
    }
  }
  return true;
}

public static boolean allAscii ( String s ) { int len = s . length ( ) ; for ( int i = 0 ; i < len ; ++ i ) { if ( ( s . charAt ( i ) & 0xff80 ) != 0 ) { return false ; } } return true ; }
determines if a string contains only ascii characters
