public static List<int> IndexesOf(this string str, string value)
{
if (String.IsNullOrEmpty(value))
throw new ArgumentException("The search string must not be empty", "value");
List<int> indexes = new List<int>();
for (int index = 0; ; index += value.Length)
{
index = str.IndexOf(value, index);
if (index == -1)
return indexes;
indexes.Add(index);
}
}