is there any method that can check if a character is uppercase or lowercase?
like the method in the String type? (toUpperCase()/toLowerCase());
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
is there any method that can check if a character is uppercase or lowercase?
like the method in the String type? (toUpperCase()/toLowerCase());
Will this do you?
Character (Java Platform SE 6))
// Json
how should i make this ryt?
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { String temp = ""; System.out.print("Enter a word: "); String word = br.readLine(); for (int x = 0; x <= word.length() - 1; x++) { temp = temp + word.charAt(x); // pseudocode: /** * if the character at (x) is equal to uppercase, * make it lower cased */ if (word.charAt(x) == Character.UPPERCASE_LETTER) { Character.toLowerCase(word.charAt(x)); } } System.out.println("All Are Lower Cased" + temp); }
Whats the point in checking if its upper case? Just lower case all characters.
Other than that you'd do something like this.
if (Character.isUpperCase(word.charAt(x))) { // Do stuff here }
// Json
chronoz13 (December 12th, 2009)
tnx sir! thats it.!
just want to clarify something..