def truncate_string(input_string, character_limit):
    """
    Used to truncate a string to ensure it may be imported into database
    :param input_string: string to be truncated
    :type input_string: str
    :param character_limit: the maximum number of allowed characters
    :type character_limit: int
    :return: truncated string (removing the trailing characters)
    :rtype: str
    """
    if len(input_string) > character_limit:
        return input_string[0:character_limit - 1]
    return input_string
