answersLogoWhite

0


Best Answer

Assuming that you want to uppercase only the vowels in a String, you can write a loop to go through all the chracters in a String and when a character is a vowel you can convert it to uppercase. I think one way to do this is as follows:

String originalString = "aobxkijejku";

StringBuffer buffer = newStringBuffer(originalString);

for(int i = 0, len = originalString.length(); i < len; i++){

if(buffer.charAt(i) 'u'){

buffer.setCharAt(i, 'U');

}

}

String modifiedString = buffer.toString();

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to Uppercase the all vowels in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Java program to convert lowercase to uppercase?

You can use the toUpperCase() method on a String to convert any String to all uppercase.


What is the case for Java keywords?

uppercase


Does Java keywords are written in lowercase as well as uppercase?

it depends mostly it is written in lower case but few start with an uppercase as Java is case sensitive


Attributes and methods of uppercase in java?

In Java toUppercase() is a method of the class String: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toUpperCase()


Why is it a bad idea to name your class string?

If you are talking about Java, that will cause confusion with the built-in "String" class. Sure, Java will distinguish "String" (with an uppercase "S") from "string" (which has no uppercase letters), but it can be confusing for the programmer. In various other programming languages, the situation may be similar.


What are the constructor method of integer class?

If you mean Java, you can get the documentation for the Integer class (with an uppercase "I") here: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html


What commands are used to prints text in java?

System.out.println("text"); or System.out.print("text"); Please note that Java is case sensitive, meaning you must match uppercase and lowercase exactly.


General syntax in creating a method?

A Java method declaration will look like this:[access modifier] [static] [final] [synchronized] [return type] [method name]([parameters])Where:access modifier is exactly one of the followingpublicprotected(no text)privatestatic, final, and synchronized are all optional.return type is exactly one of the followingvoidThe name of a Java primitiveThe name of a Java classmethod name is a valid Java identifier which must conform to all of the following rulesStarts with a lowercase letter (a-z), an uppercase letter (A-Z), a dollar sign ($), or an underscore (_)After the first character, may be a digit(0-9), a lowercase letter (a-z), an uppercase letter (A-Z), a dollar sign ($), or an underscore (_)May not be one of the Java keywordsMay not be one of the Java literals: true, false, or nullparameters is a comma-separated list of [type] [identifier] pairs, where:type is a valid Java primitive or class nameidentifier is a Java identifier, which conforms to the same rules as method name


How do you write a program using function that counts the number of vowels in a string in java language?

Use text-editor notepad++


How to convert lowercase to uppercase in java?

In Java you can invoke the toUpperCase()method on a string to convert it to a new string with all upper case characters.For example, "abc".toUpperCase() returns "ABC"Likewise, the static Character.toUpperCase(char ch) method takes a single character and returns the upper-case equivalent of that character (e.g. 'a' -> 'A').


Is there a 7 letter word with all vowels?

There are no common English words consisting of all vowels. Although A,E, I, O, and U are always vowels, Y and W can be used as vowels (e.g. Welsh). However, there are no instances where they are used as vowels along with only other vowels.Sequoia is a word using all of the vowels but not consisting of only vowels.


Name doesnt contain vowels?

all words have vowels