truncateWithCustomEllipsis static method

String truncateWithCustomEllipsis(
  1. String str,
  2. int chars,
  3. String ellipsisStr
)

Implementation

static String truncateWithCustomEllipsis(String str, int chars, String ellipsisStr)
{
   if (str.length > chars) {
    str = str.substring(0, chars - 3) + ellipsisStr;
  }

  return str;
}