VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Counts the number of the spaces and also shows the word with out the space from any where in the wo

by Alok Rai (3 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 24th May 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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




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



Download this snippet    Add to My Saved Code

Counts the number of the spaces and also shows the word with out the space from any where in the wo Comments

No comments have been posted about Counts the number of the spaces and also shows the word with out the space from any where in the wo. Why not be the first to post a comment about Counts the number of the spaces and also shows the word with out the space from any where in the wo.

Post your comment

Subject:
Message:
0/1000 characters