boolean (String text) { final int length = text.length(); if (text.charAt(length - 1) == '"') { boolean escaped = false; for (int i = length - 2; i > 0; i--) { if (text.charAt(i) == '\\') escaped = !escaped; else break; } return escaped; } return false; }