def get_string_before_delimiter(string, delimiter):
    """
        Returns contents of a string before a given delimiter
        Example: get_string_before_delimiter("banana-kiwi", "-") returns "banana"
    """
    if delimiter in string:
        return (string[:string.index(delimiter)]).strip()
    else:
        return string