cut function

String cut(
  1. String string,
  2. int length
)

Cuts the String to the required length starting from the beginning

This method works approximately like the substring one, with the difference that, if the string length is lesser than the length required the string is returned unchanged instead of throwing error

Implementation

String cut(String string, int length) => string.cut(length);