Translate

Search This Blog

Thursday, 20 March 2014

Write a program in VB 6.0 To count the frequency of a word in a given string.

Private sub command1_click()
Dim a as string
Dim b as integer
Dim c as string
Dim i as integer
Dim j as integer
Dim g as string
Dim h as string
a= text1.text
c=text2.text
b = len(c)
a= lcase(a)
h= len(a)
for i = 1 to h step 1
g = mid (a,i,b)
if g=c then
j = j + 1
End if
Next i
text3.text=j
End sub



No comments:

Post a Comment