private String findStringEnd(CharSequence s, int from) {
        boolean escaped = false;
        for (int i = from; i < s.length(); i++) {
            switch (s.charAt(i)) {
                case'\\':
                    escaped = !escaped;
                    break;
                case'"':
                    if (!escaped) {
                        return s.subSequence(from, i).toString();
                    }
                    break;
            }
        }
        return null;
    }
Special function that searches through s and returns the index
of the first occurrence of " that is not escaped.
configgen/src/main/java/com/yahoo/config/codegen/DefLine.java