boolean (String text) { if (!text.endsWith("\"")) { return false; } int i = 0; int countBackSlash = 0; int length = text.length(); while (i < length - 1) { int nextIdx = PsiLiteralUtil.parseBackSlash(text, i); if (nextIdx != -1) { countBackSlash++; i = nextIdx; } else { countBackSlash = 0; i++; } } return countBackSlash % 2 == 0; }