I want to figure out how many words are in a string but to do this I would guess that I need to figure out how many ' ' I have within the text. I have tried things such as:
print(string.match("Hello, this is ryan and welcome to my test","e"))
However, all this has done is printed the letter 'e' as that is what the string contains. Is there anything such that I can replace the letter 'e' with the amount of blank spaces there are which will also figure out the amount of words there are or will I need more script to do this task?

1 comment
I tought you want to know how many spaces or the lenght. No the blank spaces. Sorry for get confused