public static boolean needsDoubleQuotes ( String s ) { // this method should only be called for C*-provided identifiers, // so we expect it to be non-null and non-empty. assert s != null && ! s . isEmpty ( ) ; char c = s . charAt ( 0 ) ; if ( ! ( c >= 97 && c <= 122 ) ) // a-z return true ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { c = s . charAt ( i ) ; if ( ! ( ( c >= 48 && c <= 57 ) // 0-9 || ( c == 95 ) // _ || ( c >= 97 && c <= 122 ) // a-z ) ) { return true ; } } return isReservedCqlKeyword ( s ) ; }
Whether a string needs double quotes to be a valid CQL identifier .