code: def abbreviate_str(string, max_len=80, indicator="..."):
    
    if not string or not max_len or len(string) <= max_len:
      return string
    elif max_len <= len(indicator):
      return string[0:max_len]
    else:
      return string[0:max_len - len(indicator)] + indicator
docs: Abbreviate a string, adding an indicator like an ellipsis if required.