Write a code in python to remove given character from a given string.
given_string = "Hello world!"
character = "l"
def remove_char(given_string, character):
    new_string =  given_string.replace(character, "")
    return new_string