Determining the Number of Indices of a Substring within a String substringindices Determining the Number of Indices of a Substring within a String C# .Net Fun - http://www.dotnetfun.com - Michael G.
strSourceString System.String The source string to search for the number of indices of a substring. "as as as as as" strSearchString System.String The search string to search for in the source string. "as" -1) { intNumIndices++; intStartIndex = strSourceString.IndexOf(strSearchString, intStartIndex) + strSearchString.Length; } // intNumIndices = 5 ]]>