# print(name.capitalize())#首字母大写
# print(name.center(100,'S'))#50个-,把name放中间
# print('欢迎看日志'.center(100,'*'))
# file_name ='a.png'
print(file_name.endswith('.png'))#是否以x结尾
print(file_name.find('fuck'))#查找字符串的索引
print(file_name.index('fuck'))#查找字符串的索引
print(name.format(name='niuniu',age=18))#这个是格式字符串,
print(name.format_map({'name':'niuniu','age':19}))#这个也是格式化字符串,
print('%&(()()#¥23432sdfsd'.isalnum())#是否包含数字和字母
print('abA'.isalpha())#是否是英文字母
print('122'.isdigit())#是否是数字
# print('123name'.isidentifier())#是否是一个合法的变量名
# print('aaaaaAAAA'.islower())#是否是小写字母
# print('AA'.isupper())#是否是大写字母
# # print('Loadrunner Book'.istitle())#是不是一个标题,判断首字母是否大写
# print(','.join(('hehe','haha','ee')))#拼接字符串
# print(','.join(['abc','efg']))
#abcefg
# print('adbefF'.lower())#变成小写
# print('adbefF'.upper())#变成大写
# print(' mysql
'.lstrip())#默认去掉左边的空格和换行
# print('
mysql '.rstrip())#默认去掉右边的空格和换行
# print('
mysql
'.strip())#默认去掉两边边的空格和换行
st = 'idashixiong wangjuanxi'
# print(st.strip('i'))
# p = str.maketrans('abcdefg','*%^4567')#前面的字符串和后面的字符串做映射
# print('cc ae gg'.translate(p))#输出按照上面maketrans做映射后的字符串
# new_p = str.maketrans('1234567', 'abcdefg')
# print('cc ae gg'.translate(new_p))
# print('mysql is db.'.replace(' ', '')) # 替换字符串
# print('mysql is is db'.rfind('is')) # 返回最右边字符的下标
print('1 2 3 4'.split(' ')) # 分割字符串,返回一个list
src = 'niuhanyang,123456'
#niuhanyang,123456
#jmy,123456
#wjx,123456
#['niuhanyang,123456','jmy,123456','wjx,123456']
# new_src=src.split('
')
# print(new_src[0])
# print('1+2+3
1+2+3+4'.splitlines()) # 按照换行符分割
# print('Abcdef'.swapcase()) # 大小写反转