diff options
author | Kim Bauters <kim.bauters@gmail.com> | 2014-05-31 07:30:03 +0100 |
---|---|---|
committer | Kim Bauters <kim.bauters@gmail.com> | 2014-05-31 07:30:57 +0100 |
commit | a3f4b83018519895a3ff00b7a5a9a0623c3b1f17 (patch) | |
tree | 45b7b28de19cb31a0fe3756a2703513e073aa96c /tests/basics/string_istest.py | |
parent | 1f07b7e3c31b730853ec98a12dd2c7f9c70347c3 (diff) | |
download | micropython-a3f4b83018519895a3ff00b7a5a9a0623c3b1f17.tar.gz micropython-a3f4b83018519895a3ff00b7a5a9a0623c3b1f17.zip |
add methods isspace(), isalpha(), isdigit(), isupper() and islower() to str
Diffstat (limited to 'tests/basics/string_istest.py')
-rw-r--r-- | tests/basics/string_istest.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/basics/string_istest.py b/tests/basics/string_istest.py new file mode 100644 index 0000000000..7ea6c4508f --- /dev/null +++ b/tests/basics/string_istest.py @@ -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()) |