firstLineContaining method

int firstLineContaining(
  1. AFCommandContext context,
  2. RegExp match, {
  3. int startAt = 0,
})

Returns the index of the first line containing match in the file.

Optionally starts at line startAt

Implementation

int firstLineContaining(AFCommandContext context, RegExp match, { int startAt = 0 }) {
  for(var i = startAt; i < lines.length; i++) {
    final line = lines[i];
    if(line.contains(match)) {
      return i;
    }
  }
  return -1;
}