'Truncate a string by taking first and last characters.
:param str_to_truncate: the string to be truncated
:param max_num: the maximum number of characters
:returns: string -- truncated string or original string'

@staticmethod
def truncate_string(str_to_truncate, max_num):

    if (len(str_to_truncate) > max_num):
        new_num = (len(str_to_truncate) - (max_num // 2))
        first_chars = str_to_truncate[:(max_num // 2)]
        last_chars = str_to_truncate[new_num:]
        str_to_truncate = (first_chars + last_chars)
    return str_to_truncate
