def no_separators_or_newlines(string, separator='\t'):
    """Replace new lines and separators with spaces, semicolons or tabs.

    Parameters
    ----------
    string : str
        A string containing new lines and separators such as tabs,
        and commas.
    separator : str, optional
        A string that defines the type of separator. By default this is
        set to tabs.

    Returns
    -------
    str
        The passed 'string' with replacements depending on the value of 'separator'.
        If 'separator' was set to tab:
            New lines replaced with spaces, tabs replaced with spaces.
        If 'separator' was set to comma:
            New lines replaced with tabs, commas replaced with semicolons.
        If 'separator' was set to anything else:
            New lines replaced with tabs, 'separator' replaced with tabs.

    Examples
    --------
    >>> no_separators_or_newlines('This\\tis\\nSparta!')
    'This is Sparta!'

    >>> no_separators_or_newlines('This,is\\nSparta!', separator=',')
    'This;is    Sparta!'

    >>> no_separators_or_newlines('This;is\\nSparta!', separator=';')
    'This   is  Sparta!'
    """
    if separator == '\t':
        string = string.replace('\n', ' ')
        return string.replace('\t', ' ')
    elif separator == ',':
        string = string.replace('\n', '\t')
        return string.replace(',', ';')
    else:
        string = string.replace('\n', '\t')
        return string.replace(separator, '\t')
