Categories: Snippets

Find Upper Case & Lower Case

Given a string, bellow it shows the boolean condition to find Lowercase characters, Uppercase characters.

String password = "Password";
boolean hasUppercase = !password.equals(password.toLowerCase());
boolean hasLowercase = !password.equals(password.toUpperCase());

 

Recent Posts

Read Input from User

In Java, there are three different ways for reading input from the user in the…

6 years ago

Get jsp response as a string inside servlet

To get jsp response as a string inside servlet is possible by wrapping the HttpServletResponse…

6 years ago

Sorting HashMap by values in ascending and descending order

The below example shows Java program to sort a Map by values in ascending and…

6 years ago