Hi Jason ! :O)
Does anyone know of something?
I know I can parse the substrings and count them using a loop, but I'm
looking for a single function or method to simplify the process.
You could use the Regex.Split() method and look at the Length of the string
array being returned..
'**
Imports System.Text.RegularExpressions
Public Class MyApplication
Public Shared Sub Main()
Dim s As String = "alTESTskdjfTESTTESTklaTESTsdf"
Console.WriteLine(StrCount(s, "TEST"))
End Sub
Public Shared Function StrCount(ByVal text As String, ByVal find As
String) As Int32
Return Regex.Split(text, find).Length - 1
End Function
End Class
'**
--
Best Regards
Yanick