def rm_space(string):
    """
    remove the first and last space if present in the str
    """
    if " " in string[0]:
        string = string[1:]
    if " " in string[-1]:
        string = string[:-1]
    return string