firstNonSpace function

int firstNonSpace(
  1. String line
)

Index of the first character that is not a space or tab, or -1.

Implementation

int firstNonSpace(String line) {
  for (var i = 0; i < line.length; i++) {
    final c = line.codeUnitAt(i);
    if (c != _space && c != _tab) {
      return i;
    }
  }
  return -1;
}