def unquote_string(s):
    """Unquote a string value if quoted."""
    if not s:
        return s

    quote_char = s[0]
    if quote_char == "\"" or quote_char == "'":
        return s[1:(len(s) - 1)].replace("\\" + quote_char, quote_char)
    return s