Probably not the most efficient, but think it's a neat way to do it.
class Program
{
static void Main(string[] args)
{
Console.WriteLine(CountAllTheTimesThisStringAppearsInThatString("7,true,NA,false:67,false,NA,false:5,false,NA,false:5,false,NA,false", "true"));
Console.WriteLine(CountAllTheTimesThisStringAppearsInThatString("7,true,NA,false:67,false,NA,false:5,false,NA,false:5,false,NA,false", "false"));
}
static Int32 CountAllTheTimesThisStringAppearsInThatString(string orig, string find)
{
var s2 = orig.Replace(find,"");
return (orig.Length - s2.Length) / find.Length;
}
}