0

I am trying to count a few different types of characters in a string and I am running into a few problems. I need to be able to count the vowels and blanks/spaces and then just everything esle and I am having problem with the everything else(by everything else i just mean the characters other than vowels and punctuation
. If anyone can help please let me know...this is urgent.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by m610
0

I guess we missed your 30 min deadline.

How about defining a set of characters that are all vowels, consonants, punctuation, etc., then running through the string and check is each character is in any of these sets?
Check the syntax, but it would go something like:

Vowels=[A,E,I,O,U];

for i:=1 to length(MyStr) do
begin
if uppercase(S) in Vowels then inc(VowelCount);
if uppercase(S) in Consonants then inc(ConsonantCount);
etc.....
end;

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.