public static int[] GetImagePos(string str)
{
str = str.Replace("$", " ");
str = Regex.Replace(str, @"(?!<img.+?>)<.+?>", "");
str = Regex.Replace(str, @"<img\b[^>]*>", "$");
int startPos = 0;
int foundPos = -1;
int count = 0;
List<int> foundItems = new List<int>();
do
{
foundPos = str.IndexOf("$", startPos);
if (foundPos > -1)
{
startPos = foundPos + 1;
count++;
foundItems.Add(foundPos);
}
} while (foundPos > -1 && startPos < str.Length);
return ((int[])foundItems.ToArray());
}
public static int[] GetImagePos(str