1、字符串的搜索和替换
s = 'hello world hello'
#find找到子串,并返回最小的索引
print(s.find('hello'))
print(s.find('world'))
#rfind找到子串,并返回最大的索引
print(s.rfind('hello'))
#替换
print(s.replace('hello','westos'))
2、字符串对齐
print('学生管理系统'.center(30))
print('学生管理系统'.center(30,'*'))
print('学生管理系统'.ljust(30,'*'))
print('学生管理系统'.rjust(30,'*'))
3、字符串统计
print('hello'.count('l'))
print('hello'.count('