' Count the occurences of one string within another ' expC1 Character to look for ' expC2 String Public Function Occurs(ByVal tcCharacter As String, ByVal tcString As String) As Integer Dim lcString As String = "" Dim lnCount As Integer = 0 Dim lnLocation As Integer = 0 lcString = tcString Do lnLocation = lcString.IndexOf(tcCharacter, lnLocation) If lnLocation < 0 Then Exit Do Else lnCount = lnCount + 1 lnLocation = lnLocation + 1 End If Loop While True Return lnCount End Function