countStrInList method

int countStrInList(
  1. List<String> _l,
  2. String _s
)

Return >0 if String is in the List.

Implementation

int countStrInList(List<String> _l, String _s) {
  int _c = 0;
  for (var x = 0; x < _l.length; x++) {
    if (_l[x].indexOf(_s) > -1) {
      _c++;
    }
  }
  return _c; // 0-length check in the receiver side.
}