def truncate(string, length=20):
    """Truncate a string and add ellipsis, if-needed.

    Args:
        string (str): String to be truncated
        length (int, optional): Lenth of string to truncate

    Returns:
        str: Truncated string

    """
    ellipsis = '..'

    # Append ellipsis if-needed
    if len(string) > length:
        # Trim string to new length + ellipsis
        trunc = string[0:length-len(ellipsis)].strip()
        trunc += ellipsis
    else:
        # Trim string to new length
        trunc = string[0:length].strip()

    # Return truncated string
    return trunc