字符串操作 字符串对象方法 val = 'a,b, guido' val.split(',') ['a', 'b', ' guido'] pieces = [x.strip() for x in val.split(',')] pieces ['a', 'b', 'guido'] first,second,third = pieces '::'.join(pieces) 'a::b::guido' 'guido' in val True 注意find和index的区别:如果找不到字符串,inde…