limitFromEnd method

String limitFromEnd(
  1. int maxSize
)

Shrink a string to be no more than maxSize in length, extending from the end. For example, in a string with 10 charachters, a maxSize of 3 would return the last 3 charachters.

Implementation

String limitFromEnd(int maxSize) =>
    (this.length) < maxSize ? this : this.substring(this.length - maxSize);