how t ocheck if given String is in uppercase or lowercase?
how t ocheck if given String is in uppercase or lowercase?
how t ocheck if given String is in uppercase or lowercase?
You could compare the result of string.toUpperCase() to the string itself. If it was uppercase already, the 2 strings would be the same. I'll leave it up to you to work out how to check if it's lower case :-)
b yus in gprop erinterp unct ionm aybe ?
just compare it to the same string converted to uppercase or lowecase...
b yus in gprop erinterp unct ionm aybe ?
just compare it to the same string converted to uppercase or lowecase...
> String str = str. replaceAll("[A-Z]+" , "");
> i THINK THIS IS fine
I would have used String.matches(String regex) instead :)