How count occurence of a character in a string?
stefdelec
Member, PRO Posts: 146
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
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.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support