limitFromEnd method
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 ?? 0) < maxSize ? this : this!.substring(this!.length - maxSize);