len(text) gives you the length of the text
tokecount(text," ") gives you how many words are in the text.
with tokenat(text,index," ") you can get a specific word of the text based on its index
With these you can create a system to do what you want.
To read more about system expressions, check this:
https://www.construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions