| | |
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 |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card chat class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image input integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan loop machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project radio recursion reporting scanner se server service set sms socket software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows






