String (@NotNull String text) { int length = text.length(); StringBuilder result = new StringBuilder(length); int i = 0; while (i < length) { int nSlashes = 0; int next = i; while (next < length && (next = PsiLiteralUtil.parseBackSlash(text, next)) != -1) { nSlashes++; i = next; } if (i >= length) { result.append(StringUtil.repeatSymbol('\\', nSlashes)); break; } next = parseQuote(i, text, nSlashes, result); if (next != -1) { i = next; continue; } if (nSlashes != 0) { i = parseEscapedChar(i, text, nSlashes, result); } else { result.append(text.charAt(i)); i++; } } return result.toString(); }