public static int ContainCount(string input, string findstr, bool ignoreCase)
{
if (ignoreCase)
{
input = input.ToLower();
findstr = findstr.ToLower();
}
int count = 0;
for (int i = 0; (i = input.IndexOf(findstr, i)) >= 0; i=i+findstr.Length)
{
count++;
}
return count;
}