Python's string module has a few handy operations that will return a certain character sets, such as all the uppercase characters. Is there anything similar for Java?
http://docs.python.org/2/library/string.html
string.ascii_lowercase
The lowercase letters 'abcdefghijklmnopqrstuvwxyz'.
string.ascii_uppercase
The uppercase letters 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
string.digits
The string '0123456789'.
string.punctuation
String of ASCII characters which are considered punctuation characters in the C locale.
No. You'd need to write a loop:
String result = "";
for (char c = 'A'; c <= 'Z'; c++) {
result += c;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With