Count the words in a string

Hi guys !

I want to count the words (substrings) in a string
Example : this is robot
answer should be 3

Thanks in advance !!

2 Likes

Split the string by a space and count the number of strings in the resulting array using vb.

Something like: ("Hello world!").Split(" "c).Count.ToString

3 Likes

@dmccammond
its working fine !!!
Thank you so much…

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.