class DotByTildaEscapeUtil {

    public String escapeDot(String toEscape){
        String result = toEscape;
        if (result.contains(ESCAPE_CHARACTER)) {
            result = result.replace(ESCAPE_CHARACTER, DOUBLE_ESCAPE_CHARACTER);
        }
        if (result.contains(DELIMITER_CHARACTER)) {
            result = result.replace(DELIMITER_CHARACTER, ESCAPED_DELIMITER_CHARACTER);
        }
        return result;
    }

}