How count occurence of a character in a string?
Hi everyone,
How can I count occurence of a character in a string?
I'd like to know many a,e,i,o,u,y there is in a string. How could I do that?
Tks,
Stéphane.
Hi everyone,
How can I count occurence of a character in a string?
I'd like to know many a,e,i,o,u,y there is in a string. How could I do that?
Tks,
Stéphane.
Comments
Use a loop to loop through the word. With each cycle, use the substring function to look at each individual letter in the word. Use a rule to evaluate if it's a vowel. If it is, add to an attribute.
That was my guess too... Thanks. Thought there would be an easier way to do it.
Are you wanting to find out how many vowels are in a string, or how many of a particular letter are in a string?
In this purpose, how many vowels (except Y)
Here is a project to do pattern count in a text. It is case sensitive.
Here's a bit of both.