Advertisement
2002ASP String Manipulation #3935

Character counter

A FAST and EASY way to count the number of occurrences of one string within another! Please vote for this tip if you find it useful.

AI

Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kode Sumber
original-source
Private Sub Test()
Const mystr = "This is a test of the split function"
' returns 6
Debug.Print Occurs(mystr, "t")
End Sub
Public Function Occurs(ByVal strtochk As String, ByVal searchstr As String) As Long
' remember SPLIT returns a zero-based array
Occurs = UBound(Split(strtochk, searchstr)) + 1
End Function
Komentar Asli (3)
Dipulihkan dari Wayback Machine