aspose file tools*
The moose likes Beginning Java and the fly likes Java array help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java array help" Watch "Java array help" New topic
Author

Java array help

Tracie Marshall
Greenhorn

Joined: Jan 24, 2010
Posts: 1
So, I have this code and I have an array of alphabets which I've copied into a new array. No I need to go through the array and print the vowels "a,e,i,o,u" in uppercase. I was wondering if anyone could help me.
Thanks!

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
I don't really get the sense of it but this should help

first, your array should be of type char and not String...

you can also iterate over the array using the enhanced for loop .


JDBCSupport - An easy to use, light-weight JDBC framework -
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

I don't get it either. Why are you using an arraycopy?
But instead of String.valueOf(c).toUpperCase() I would use Char.toUpperCase(c);


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
Consider Paul's rocket mass heater.
 
subject: Java array help