Results 1 to 5 of 5
- 06-22-2011, 12:06 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 7
- Rep Power
- 0
-
How would you do this on paper? Once you work that out, you'd use the same logic in your Java program.
- 06-22-2011, 12:15 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 7
- Rep Power
- 0
bt how can i run a loop for A to Z since its not working with ascii codes
-
You wouldn't. You'd loop through the char's found in the String. You could have an int array that represents your 'A' through 'Z' and if an 'a' or 'A' is encountered in the String increment your 0th array element by one. Note that you can do arithmetic on characters. So 'B' - 'A' equals 1, and 'C' - 'A' equals 2. Just be sure to get your case right.
- 06-23-2011, 09:05 PM #5
Member
- Join Date
- Apr 2011
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
Counting occurence of a word in file
By KAS in forum New To JavaReplies: 15Last Post: 05-16-2011, 06:47 PM -
Preventing errors when typing a letter into a String
By doymand in forum New To JavaReplies: 5Last Post: 10-30-2010, 06:56 PM -
Searching the first occurence
By The Hawk in forum New To JavaReplies: 7Last Post: 11-29-2009, 12:36 PM -
String is not accepting "*" letter, please help me to solve
By srisar in forum New To JavaReplies: 18Last Post: 07-12-2009, 05:47 PM -
the number of occurrences of each alphabetical letter in the string.
By masaka in forum New To JavaReplies: 20Last Post: 05-14-2008, 09:42 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks