fromString static method
Implementation
static List<HighlightIndex> fromString(String content, String highlight) {
List<int> indexes = [];
int idxStart = 0;
while (true) {
final index = content.indexOf(highlight, idxStart);
if (index >= 0) {
indexes.add(index);
idxStart += index + highlight.length;
} else {
return indexes.map((e) => HighlightIndex(e, highlight.length)).toList();
}
}
}