-
February 24th, 2014, 11:42 AM
#1
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.
-
February 25th, 2014, 01:46 AM
#2
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!
-
March 5th, 2014, 01:36 PM
#3
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
Always use [code][/code] tags when posting code.
-
March 8th, 2014, 01:52 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|