def dequote_string(s):
    """Removes quotation marks from a string according to the DND
    protocol rules.  Internal quotations ("") are replaced with single
    quotes, and the leading and trailing quotes are stripped.
    
    See also:  enquote_string()
    """
    if s.startswith('"'):
        s = s[1:]
    if s.endswith('"'):
        s = s[:-1]

    return s.replace('""', '"')