def replace_escapes(text):
    """
        Replace escape sequences with the characters they represent
    :param text: string to replace escapes in
    :return: New string with escapes replaced by the represented characters
    """
    escape = False
    out = ""
    for char in text:
        if escape is True:
            if char == "t":
                out += "\t"
            elif char == "n":
                out += "\n"
            elif char == "s":
                out += " "
            else:
                out += char
            escape = False
            continue
        if char == "\\":
            escape = True
        else:
            out += char
    return out