removeFirst method

String removeFirst([
  1. int n = 1
])

Removes the first n characters from the String.

Example

String foo = 'esentis'
String newFoo = foo.removeFirst(3) // 'ntis';

Implementation

String removeFirst([int n = 1]) {
  if (isBlank || n <= 0) {
    return blankIfNull;
  }

  if (n >= length) {
    return '';
  }
  return substring(n, length);
}