findAndReplace method

int findAndReplace(
  1. String sheet,
  2. Pattern source,
  3. dynamic target, {
  4. int first = -1,
  5. int startingRow = -1,
  6. int endingRow = -1,
  7. int startingColumn = -1,
  8. int endingColumn = -1,
})

Replaces occurrences of source with target in sheet. Returns the count of replacements.

Implementation

int findAndReplace(String sheet, Pattern source, dynamic target,
    {int first = -1,
    int startingRow = -1,
    int endingRow = -1,
    int startingColumn = -1,
    int endingColumn = -1}) {
  int replaceCount = 0;
  if (_sheetMap[sheet] == null) return replaceCount;

  _sheetMap[sheet]!.findAndReplace(
    source,
    target,
    first: first,
    startingRow: startingRow,
    endingRow: endingRow,
    startingColumn: startingColumn,
    endingColumn: endingColumn,
  );

  return replaceCount;
}