counting special characters from a text file

kamote's Avatar
Newbie Member
i was able to create a program on how to count words from a text file but im having problems on how to count and display the "special characters" from this text file. Im referring to special characters like "." ";" "?" "!" "(" etc...

any ideas?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Loop through the string in the same manner as you do for the characters and add each numbers when any such character is found.