| | |
help needed badly
![]() |
Hello I need help. I need to write a program that changes all upper case letters to lower case letters and all lower case letters to upper case then the vowels with an *...
it would look like this
normal= UppER loweR caSe
output should be this..
*PP*r L*W*r C*s*..
i already know how to change all lower case to upper case and vice versa if it's a sentence..but i don't know how to do it per letter..
can anyone pls help me..:cheesy:plzzzzz
it would look like this
normal= UppER loweR caSe
output should be this..
*PP*r L*W*r C*s*..
i already know how to change all lower case to upper case and vice versa if it's a sentence..but i don't know how to do it per letter..
can anyone pls help me..:cheesy:plzzzzz
You have to analyze the input one character at a time...
Say we have a string: myStringThere are other ways to do this, but the above should work for general purpose.
Set up a for loop with a lower limit of 0 and an upper limit ofmyString.length()-1inclusive
Read each character one at a time withmyString.charAt(int index)
Analyze the single character. What is it? A vowel? Upper-case? Lower-case?
Append the new character to another string / a buffer.
Next character in the loop...
Last edited by Cudmore; Feb 17th, 2007 at 10:57 am.
synchronized (theWorld) { System.out.println ("It's all mine..."); }
How many people have code in their Sigs?
How many people have code in their Sigs?
Easiest (and fastest) is to use regular expressions to replace all uppercase letters with an asterisk, then call toUppercase() on the resulting string.
Far more elegant (and possibly faster, especially with long strings) than looping through every character.
Far more elegant (and possibly faster, especially with long strings) than looping through every character.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- Help needed in graphics.h (C++)
- Java tutor needed BADLY (Java)
- My story, funny hardware, and the ghost in the machine. (Motherboards, CPUs and RAM)
- Need help on homework (C++)
- help me on my case study!!! (C)
- Recursive help needed badly! (Java)
Other Threads in the Java Forum
- Previous Thread: hey guys i need help to
- Next Thread: word counter, frequency, percentage
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application arguments array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class client code color component count database derby design eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui homework html ide if_statement image integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel julia keyword linux list macintosh map method methods midlethttpconnection mobile netbeans newbie nullpointerexception object open-source os problem producer program programming project projectideas property read recursion reference replaysolutions ria scanner search server set size sms sort sourcelabs splash sql sqlite stop string swing testautomation threads transforms tree ui unicode validation windows






