aStr = 'hello wel\rcome \t to \t zy \n oYeah'
print(''.join(aStr.split()))
首先奖原字符串进行分割,然后组合
split() --> ['hello', 'wel', 'come', 'to', 'zy', 'oYeah']
join() --> hellowelcometozyoYeah
aStr = 'hello wel\rcome \t to \t zy \n oYeah'
print(''.join(aStr.split()))
首先奖原字符串进行分割,然后组合
split() --> ['hello', 'wel', 'come', 'to', 'zy', 'oYeah']
join() --> hellowelcometozyoYeah