trimLength method
The string trimmed from both sides by the given length
.
final trimmed = '[Dee, is, a, bird]'.trimLength(1);
print(trimmed); // 'Dee, is, a, bird'
Implementation
String trimLength(int length) => substring(length, this.length - length);