dropFirst method

String dropFirst()

Returns a new string with the first character removed.

Returns an empty string if the string is empty.

Example:

String name = 'Hello';
name = name.dropFirst(); // 'ello'

Implementation

String dropFirst() {
  if (isEmpty) return this;
  return length > 1 ? substring(1) : '';
}