import re


def clean_string(string):
    """
    Clean a given string from Umlauts and unwanted characters to ensure
    compatibility with the file system.
    :param string: String that needs cleaning
    :type string: string
    :return: Cleaned string
    """
    string = re.sub('Ä', 'Ae', string)
    string = re.sub('ä', 'ae', string)
    string = re.sub('Ö', 'Oe', string)
    string = re.sub('ö', 'oe', string)
    string = re.sub('Ü', 'Ue', string)
    string = re.sub('Ü', 'ue', string)
    string = re.sub('ß', 'ss', string)
    # Avoid slashes in names because they represent sub-dirs
    string = re.sub('/', ' ', string)
    return string