How to count the number of spaces and words?
x = "Madhavi QTP"
words_S = split(x)
msgbox "No. of words are :"&Ubound(words_S)+1
msgbox "No. of spaces are :" &Ubound(words_S)
For each k in words_S
char_len = char_len + len(k)
Next
msgbox "No. of charcters excluding space are :"&char_len
words_S = split(x)
msgbox "No. of words are :"&Ubound(words_S)+1
msgbox "No. of spaces are :" &Ubound(words_S)
For each k in words_S
char_len = char_len + len(k)
Next
msgbox "No. of charcters excluding space are :"&char_len
Comments
Post a Comment