from typing import Optional


def replace_string_chars(
    string: str, replace: Optional[dict] = None, remove: Optional[list] = None
) -> str:
    """
    Removes and replaces characters from a given string according to the input.

    Parameters
    ----------
    string
        The string to be modified.
    replace
        The keys are the characters to be replaced, the values are stating their
        replacements.
    remove
        A list of characters to be removed from the given string.

    Returns
    -------
     string
        The modified string with removed/replaced characters.
    """
    # first, do the replacements
    if replace is not None:
        for char, replacement in replace.items():
            string = string.replace(char, replacement)
    # finally, remove characters as requested
    if remove is not None:
        for char in remove:
            string = string.replace(char, "")
    return string