def replace_cid_codes(string):
    """ Takes a string and replaces relevant cid codes
    :param string: string with cid codes
    :return: string with relevant cid codes replaced
    """

    # letters
    string = string.replace('(cid:228)', 'ä')
    string = string.replace('(cid:246)', 'ö')
    string = string.replace('(cid:252)', 'ü')

    string = string.replace('(cid:214)', 'Ö')
    string = string.replace('(cid:220)', 'Ü')
    string = string.replace('(cid:223)', 'ß')

    string = string.replace('\n', ' ')
    string = string.replace('\r', '')

    return string