limitFromStart method

String? limitFromStart(
  1. int maxSize
)

Shrinks the string to be no more than maxSize in length, extending from the start. Example: In a string with 10 characters, a maxSize of 3 would return the first 3 characters.

Implementation

String? limitFromStart(int maxSize) =>
    (this?.length ?? 0) < maxSize ? this : this!.substring(0, maxSize);