Please enable JavaScript.
Coggle requires JavaScript to display documents.
STRING MANIPULATION, vì string immutable, could be chained : - Coggle…
STRING MANIPULATION
Method
removing character:
strip()
count( )
and
replace( )
Adjusting case
a.upper()
a.swapcase()
a.lower()
a.capitalize()
a.title()
split( )
and
join( )
join( ): join the list into string
split( ): divide string & return list
thực chất là tạo chuỗi mới và trả kq chuỗi đó
Special character: /
tab: \t
new line: \n
escaping: \' \'
Modify a string
profit by list
mutable
characteristic
assign value
to index of list
' '.join( ):
convert list to string
convert to list:
list(string)
separate string and add string into it
String is
immutable
:
cannot change value when string is defined
vì string immutable
could be chained
: