to calculate vowels, consonants, and spaces in the text entered
Hi everyone,
need some help to create function to calculate vowels, consonants, and spaces in the text entered.
have to use loops with Mid and Len
any advice appreciated.
Thanks.
Re: to calculate vowels, consonants, and spaces in the text entered
Write the steps down on a piece of paper, breaking down each process along the way. Test on paper, and when it works, start coding it!
Re: to calculate vowels, consonants, and spaces in the text entered
Create a array of vowels
If a loop count the number of spaces
In another nested loop count the number of each of the entries in your array
Check the length of the text then subtract the number of spaces and the number of vowels to get the number of consonants
See .IndexOf method of the string class
Re: to calculate vowels, consonants, and spaces in the text entered
Mid and Len are still VB6 functions. I'd suggest having a look here at some of the String ( as Dm pointed out ) methods :
http://www.codeguru.com/columns/vb/b...-in-vb.net.htm