middleEllipsis method

String middleEllipsis({
  1. int start = 6,
  2. int end = 6,
})

Implementation

String middleEllipsis({int start = 6, int end = 6}) {
  if (length < (start + end)) {
    return this;
  }
  return replaceRange(start, length - end, "……");
}