Private Sub cmdS_Click Dim As Integer As Integer As Integer As Integer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Private Sub cmdS_Click()
Dim i As Integer, K As Integer, l As Integer, p As Integer
s = "óëèöà íî÷ü óëèöà íî ôîíàðü àïòåêà ñîí"
l = Len(s)
p = l + 1: K = -1:
For i = 1 To l
K = K + 1
If Asc(Mid(s, i, 1)) = 32 Then
If p > K Then
sl = Mid(s, i - K, K)
p = Len(sl)
End If
K = -1
End If
Next i
lblK.Caption = sl
End Sub