- Home
·
- String Manipulation
·
- Counts the number of the spaces and also shows the word with out the space from any where in the wo
Counts the number of the spaces and also shows the word with out the space from any where in the wo
Counts the number of the spaces and also shows the word with out the space from any where in the words
Rate Counts the number of the spaces and also shows the word with out the space from any where in the wo
(2(2 Vote))
Public Function Stringwithoutspace(str1 As String, str2 As String)
str2 = ""
For I = 1 To Len(str1)
A = Mid(str1, I, 1)
If Not (A = " ") Then
str2 = str2 & A
End If
Next I
Stringwithoutspace = str2
End Function
'-------------------------------------------------------------------------------
Public Function calculatespace(str As String, counter As Integer)
For I = 1 To Len(str)
A = Mid(str, I, 1)
If A = " " Then
counter = counter + 1
End If
Next I
calculatespace = counter
End Function
'-------------------------------------------------------------------------------
Private Sub Text1_Change()
Text2.Text = calculatespace(Text1.Text, 0)
Text3.Text = Stringwithoutspace(Text1.Text, "")
End Sub
Counts the number of the spaces and also shows the word with out the space from any where in the wo Comments
No comments yet — be the first to post one!
Post a Comment