take method

String take(
  1. int count
)

Returns the string prefix with count characters. If count is larger than length return the whole string.

Implementation

String take(int count) => substring(0, min(count, length));