Is there is away to count the message words?

(M E) #1

hey
is there is a way to count the messages words ?
i try get lenght but it count characters not words

(Karen Barker) #2

Hi Mohammed,

The only way to count the number of words would be to use the code service. The basic premise would be to use a regular expression to split the message on a space and then store the words as an array. You could then return the length of the array to return the number of words in the original message.

Give it a go and if you get stuck then post your code and I’m sure someone will be able to help you. :thumbsup:

1 Like