This is not working properly, what is problem, ty!
Private Sub Command1_Click()
Dim rijeci() As String, i As Integer, j As Integer, rijec As String
rijeci = Split(Text1.Text, " ")
Dim najcesca() As String, ponavljanja() As Integer, r As String, rr As Integer, brojac As Integer
For i = 0 To UBound(rijeci)
rijeci(i) = LCase(ValidateString(rijeci(i)))
brojac = 0
For j = 0 To UBound(rijeci)
If rijeci(i) = rijeci(j) Then brojac = brojac + 1
Next j
If brojac > rr Then
rr = brojac
r = rijeci(i)
End If
Next i
Text2.Text = CStr(r)
Text3.Text = CStr(rr)
End Sub
Function ValidateString(strInput As String) As String
Dim strInvalidChars As String
Dim i As Long
strInvalidChars = "!\#$%&/()=?*+;:,.-_{}[]\"""
For i = 1 To Len(strInvalidChars)
strInput = Replace$(strInput, Mid$(strInvalidChars, i, 1), "")
Next
ValidateString = strInput
End Function
Private Sub Command1_Click()
Dim rijeci() As String, i As Integer, j As Integer, rijec As String
rijeci = Split(Text1.Text, " ")
Dim najcesca() As String, ponavljanja() As Integer, r As String, rr As Integer, brojac As Integer
For i = 0 To UBound(rijeci)
rijeci(i) = LCase(ValidateString(rijeci(i)))
brojac = 0
For j = 0 To UBound(rijeci)
If rijeci(i) = rijeci(j) Then brojac = brojac + 1
Next j
If brojac > rr Then
rr = brojac
r = rijeci(i)
End If
Next i
Text2.Text = CStr(r)
Text3.Text = CStr(rr)
End Sub
Function ValidateString(strInput As String) As String
Dim strInvalidChars As String
Dim i As Long
strInvalidChars = "!\#$%&/()=?*+;:,.-_{}[]\"""
For i = 1 To Len(strInvalidChars)
strInput = Replace$(strInput, Mid$(strInvalidChars, i, 1), "")
Next
ValidateString = strInput
End Function