code: public static String abbreviate(String _str, int _length) {
          if (_str == null) {
              return null;
          }
          if (_str.length() <= _length) {
              return _str;
          }
  
          String abbr = _str.substring(0, _length -3) + "...";
  
          return abbr;
      }
docs: Abbreviates a String using ellipses.
  
  @param _str string to abbrivate
  @param _length max length
  @return abbreviated string, original string if string length is lower or equal then desired length or null if input was null