static int countQuotes(String string, int from, int to) {
        int count = 0;

        int escape = 0;
        for (int i = from; i < to; i++) {
            if (string.charAt(i) == '"' && escape % 2 == 0) {
                count++;
            }
            escape = (string.charAt(i) == '\\') ? escape + 1 : 0;
        }

        return count;
    }
static int countQuotes ( String string , int from , int to ) { int count = 0 ; int escape = 0 ; for ( int i = from ; i < to ; i ++ ) { if ( string . charAt ( i ) == '"' && escape % 2 == 0 ) { count ++ ; } escape = ( string . charAt ( i ) == '\\' ) ? escape + 1 : 0 ; } return count ; }
/*
Counts double quotes in string.
Escaped quotes are ignored.