11.09.2013, 03:00
Aca te dejo una funcion que hace lo que pides, la hice algo generica aun que podria mejorarse. Cualquier cosa me avisas:
Код:
Public Function CountReps(ByVal text As String, ByVal word As String, Optional ByVal separator As String = " ", Optional ByVal sensitive As Boolean = False) As Integer Dim count As Integer, _ Items() As String If (sensitive = False) Then word = word.ToLower() text = text.ToLower() separator = separator.ToLower End If Items = text.Split(separator) For Each item As String In Items If item = word Then count += 1 End If Next Return count End Function