1. #判断空白字符
    2. space_str = " " #space 空白
    3. print(space_str.isspace())
    4. #常用
    5. # space_str.isalnum() 字符是全是数字或者字母 返回 True
    6. # space_str.isdecimal() 只包含数字 返回 True
    7. # space_str.istitle() 是标题话的每个单词的首字母大写 返回true
    8. # space_str.islower() 中包含至少区分大小写的字母 ,并且所有这些(区分大小写的字符都是小写 返回true)
    9. # space_str.isupper() 中包含至少区分大小写的字母 ,并且所有这些(区分大小写的字符都是大写 返回true)
    10. # space_str.isnumeric() 只包含数字 返回 True 全角数字,汉字数字
    11. hello_str = "hi hello"
    12. #判断是否以指定字符串开始
    13. print(hello_str.startswith("Hello"))
    14. #判断是否以指定字符串结尾
    15. print(hello_str.endswith("hello"))
    16. #查找指定字符串
    17. #index 同样可以查找字符串在大字符串中的索引 如果没有数据 会报错
    18. #fand 如果指定的字符串不存在 会返回 -1 不报错
    19. print(hello_str.find("llo"))
    20. #替换字符串
    21. #replace 方法执行完成后 ,会返回一个新的字符串
    22. #注意:不会修改原有字符串的内容
    23. print(hello_str.replace("hello","python"))