def truncate_string(input_string, character_limit):
    """Used to truncate a string to ensure it may be imported into database

    Parameters
    ----------
    input_string : str
        string to be truncated
    character_limit : int
        the maximum number of allowed characters

    Returns
    -------
    str
        truncated string

    """
    if len(input_string) > character_limit:
        return input_string[0 : (character_limit - 1)]
    return input_string