add methods isspace(), isalpha(), isdigit(), isupper() and islower() to str

This commit is contained in:
Kim Bauters
2014-05-31 07:30:03 +01:00
parent 1f07b7e3c3
commit a3f4b83018
4 changed files with 102 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
print("".isspace())
print(" \t\n\r\v\f".isspace())
print("a".isspace())
print(" \t\n\r\v\fa".isspace())
print("".isalpha())
print("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".isalpha())
print("0abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".isalpha())
print("this ".isalpha())
print("".isdigit())
print("0123456789".isdigit())
print("0123456789a".isdigit())
print("0123456789 ".isdigit())
print("".isupper())
print("CHEESE-CAKE WITH ... _FROSTING_*99".isupper())
print("aB".isupper())
print("".islower())
print("cheese-cake with ... _frosting_*99".islower())
print("aB".islower())
print("123".islower())
print("123a".islower())