name=" aleX "
name=" aleX " v=name.strip() print(v)
name="aleX" if name.find("al")==0: print("是") else: print("否")
name="aleX" if name.find("X")==name.__len__()-1: print("是") else: print("否")
name="aleX" v=name.replace("l","p") print(v)
name="aleX" v=name.split("l") print(v)
name="aleX" v=name.upper() print(v)
name = "aleX" v = name.lower() print(v)
name="aleX" v=name[1:2] print(v)
name="aleX" v=name[0:3] print(v)
name="aleX" v=name[name.__len__()-2:name.__len__()] print(v)
name="aleX" v=name.find("e") print(v)
name="oldboy" v=name[0:name.__len__()-1] print(v)
原文:https://www.cnblogs.com/panyizuoshan/p/10587923.html