Python3 字符串String Istitle 方法
Python3 字符串String Istitle 方法 #!/usr/bin/python3 str = "This Is String Example...Wow!!!" print (str.istitle()) str = "This is string example....wow!!!" print (str.istitle())
阅读全文 ↗Python3 字符串String Istitle 方法 #!/usr/bin/python3 str = "This Is String Example...Wow!!!" print (str.istitle()) str = "This is string example....wow!!!" print (str.istitle())
阅读全文 ↗Python3 字符串String Isspace 方法 #!/usr/bin/python3 str = " " print (str.isspace()) str = "This is string example....wow!!!" print (str.isspace())
阅读全文 ↗Python3 字符串String Isnumeric 方法 #!/usr/bin/python3 str = "this2016" print (str.isnumeric()) str = "23443434" print (str.isnumeric())
阅读全文 ↗Python3 字符串String Islower 方法 #!/usr/bin/python3 str = "THIS is string example....wow!!!" print (str.islower()) str = "this is string example....wow!!!" print (str.islower())
阅读全文 ↗Python3 字符串String Isdigit 方法 #!/usr/bin/python3 str = "123456"; # Only digit in this string print (str.isdigit()) str = "this is string example....wow!!!" print (str.isdigit())
阅读全文 ↗Python3 字符串String Isalpha 方法 #!/usr/bin/python3 str = "this"; # No space & digit in this string print (str.isalpha()) str = "this is string example....wow!!!" print (str.isalpha())
阅读全文 ↗Python3 字符串String Isalnum 方法 #!/usr/bin/python3 str = "this2016" # No space in this string print (str.isalnum()) str = "this is string example....wow!!!" print (str.isalnum())
阅读全文 ↗Python3 字符串String Index 方法 #!/usr/bin/python3 str1 = "this is string example....wow!!!" str2 = "exam"; print (str1.index(str2)) print (str1.index(str2, 10)) print (str1.index(str2, 40))
阅读全文 ↗Python3 字符串String Find 方法 #!/usr/bin/python3 str1 = "this is string example....wow!!!" str2 = "exam"; print (str1.find(str2)) print (str1.find(str2, 10)) print (str1.find(str2, 40))
阅读全文 ↗Python3 字符串String Expandtabs 方法 #!/usr/bin/python3 str = "this is\tstring example....wow!!!" print ("Original string: " + str) print ("Defualt exapanded tab: " + str.expandtabs()) print ("Double exapanded tab: " + str.expandtabs(16))
阅读全文 ↗Python3 字符串String Endswith 方法 #!/usr/bin/python3 Str='this is string example....wow!!!' suffix='!!' print (Str.endswith(suffix)) print (Str.endswith(suffix,20)) suffix='exam' print (Str.endswith(suffix)) print (Str.endswith(suffix, 0, 19))
阅读全文 ↗Python3 字符串String Encode #!/usr/bin/python3 import base64 Str = "this is string example....wow!!!" Str = base64.b64encode(Str.encode('utf-8',errors = 'strict')) print ("Encoded String: " , Str)
阅读全文 ↗