Deletions change search string operation

Deletions search string change operation 
by:
A = "Alex"
B = "LHF"
C = A + B
Print (C)

puncturing : Strip
A = "+++ haohaohoa___"
B = a.strip () Strip (. " + ")
Print (B)
C = a.lstrip ()
Print (C)
D = a.rstrip ()
Print (D)


change: replace, replacement substring, lower, uppercase to lowercase, upper, lowercase uppercase.
= A "Alex"
B = a.replace ( "EX", "OO")
C = a.lower ()
D = A.upper ()
Print (B, C, D)


to check: index, starting from the left to find index corresponding element, take the first, the error can not be found. find .... take the first one, the return can not find a specific value. count, look for a specific number of characters appearing in the string
title: will capitalize the first letter
A = "alex"
Print (a.index ( "A"))
Print (a.find ( "b"))
Print (a.find ( "A"))
Print (A.


print(a.title())

Guess you like

Origin www.cnblogs.com/yyk520/p/11431777.html