Well, learning other languages has not been practiced all the time, hehe.
test.py
1 #-*-Coding:utf-8-*-
2
3 str = "I am worker"
4 Print str.capitalize ()
5 Print Str.center (20)
6 print Str.count (")
7 Print Str.count (", 0, 4)
8 str1 = "China"
9 Str1.decode (' Utf-8 '). Encode (' gb2312 ')
Ten print str1
One str2 = U ' China '
Str2.encode (' gb2312 ')
Print str2
Print Str.endswith (' er ')
Print Str.endswith (' er ', 0, 6)
STR3 = ' 1 3 5 '
Print STR3
Print Str3.expandtabs ()
Print Str3.expandtabs (1)
Print Str.find (' m ', 0, Len (str))
#print str.index (' h ', 0, Len (str)) #exception
Print ". Isalnum ()
print '? 1a '. Isalnum ()
print ' 1a '. Isalnum ()
print ' 1 '. Isalpha ()
#print ' isdecimal ', ' 1a '. Isdecimal () #no Implement
print ' isdigit ', ' 1a '. IsDigit ()
#print ' IsNumeric ', ' 1a '. IsNumeric () #no Implement
print ' islower ', ' 1a '. Islower ()
Print ". Isspace ()
print ' You are fool '. Istitle ()
print ' You are fool '. Istitle ()
print ' 1a '. Isupper ()
print ' and '. Join ([' 1 ', ' 2 ', ' 3 '])
print ' 123 '. Ljust #make no sense of
print ' ABC '. Lower ()
PNS print ' abc '. UPPER ()
print ' AbAB '. Lstrip ()
#print ' 123abc ' Maketrans (' 123 ', ' ABC ') #no implement
+ print ' 123 '. partition (' 2 ')
print ' 123 '. partition (' 1 ')
print ' 123 '. Partition (' 3 ')
print ' 123 '. Partition (' 4 ')
print ' 113 '. Replace (' 1 ', ' 2 ')
print ' 113 '. Replace (' 1 ', ' 2 ', 1)
print ' 11a '. RFind (' a ')
print ' 11a '. Rindex (' a ')
print ' 123 '. Rjust (8)
print ' 123 '. Rpartition (' 2 ')
print ' 123 '. Rstrip ()
print ' 12134 '. Split (' 1 ')
print ' 12134 '. Split (' 1 ', 1)
print ' 1\r2\r\n3\n '. Splitlines (True)
print ' 1\r2\r\n3\n '. Splitlines (False)
print ' 123 '. StartsWith (' 1 ')
+ print ' 123 '. Strip ()
print ' Ababab '. Swapcase ()
print ' abc def HGJ '. Title ()
1aabb?>< ' Translate (None, ' <> ')
print ' 123 '. Zfill (8)
Print U ' 123 '. Isdecimal ()
+ Print U ' aebf '. Isdecimal ()
Result
# python test.py
I am Worker
I am worker
2
1
China
China
True
False
135
1 3 5
1 3 5
3
False
False
True
False
IsDigit False
Islower True
True
False
True
False
1and2and3
123
Abc
Abc
AbAB
(' 1 ', ' 2 ', ' 3 ')
(', ' 1 ', ' 23 ')
(' 12 ', ' 3 ', ')
(' 123 ', ', ')
223
213
2
2
123
(' 1 ', ' 2 ', ' 3 ')
123
[' ', ' 2 ', ' 34 ']
[', ' 2134 ']
[' 1\r ', ' 2\r\n ', ' 3\n ']
[' 1 ', ' 2 ', ' 3 ']
True
123
Ababab
ABC Def Hgj
1aAbB?
00000123
True
False
Finally:
There must be something you need.
Python string method