You should try:
If s(i) = " " Then
a space was added between quotes
Otherwise, you can simplify your code:
Public Sub word()
Dim l, i , number As Integer
no = 0
Console.WriteLine("Type the text")
s = Console.ReadLine()
l = Len(s)
Do While (i < l)
If s(i) = " " Then
no = no + 1
End If
i = i + 1
number = no
Loop
Console.WriteLine("The no of words is {0}", number no)
End Sub
End Class