from re import sub


def replace(given_text: str, sub_string: str, replacable_str: str) -> str:
    """Replace a substring with another string from a given text.

    Args:
        given_text (str): the full text where to be replaced
        sub_string (str): the string to be replaced
        replacable_str (str): the new replaced string

    Returns:
        str: stripped replaced text
    """
    return sub(sub_string, replacable_str, given_text).strip()