elemIndicesString function
List of every index of sub
in original
Implementation
List<int> elemIndicesString(String sub, String original) {
if (sub.isEmpty || original.isEmpty) {
return [];
}
List<int> result = [];
for (int i = 0; i < original.length; i++) {
if (original.substring(i).startsWith(sub)) {
result.add(i);
}
}
return result;
}