I am trying to find how many times the word "Serotonin" appears in the gathered web data but cannot find a method for finding the number of times.
IEnumerator OnMouseDown()
{
string GatheredData;
StringToFind = "Serotonin"
string url = "https://en.wikipedia.org/wiki/Dopamine";
WWW www = new WWW(url);
yield return www;
GatheredData = www.text;
//Attempted methods below
M1_count = GatheredData.Contains(StringToFind);
M1_count = GatheredData.Count(StringToFind);
M1_count = GatheredData.IndexOf(StringToFind);
}
I can easily use the data from those methods 1 and 3 when I tell it what number in the index and method 2 would work but only works for chars not strings
I have checked online and on here but found nothing of finding the count of the StringToFind