import re


def generate_new_string(arr, str):
    """
    Function that takes in an array and a string and returns a new string.
    A new string will be emptied of all contents between any instance of `{}`
    and then all instances of `{}` will be replaced with each element of the
    input array. The new string is then returned.
    """
    emptied_string = re.sub((r"(?<={)[\w<>' -]+(?=})"), '', str)
    final_string = emptied_string.format(*arr)
    return final_string