标签: python string list split
所以有一个字符串foo = 'asdfasdfzxc<test>afx<one>' 如何获得bar = ['asdfasdfzxc','test','afx','one']?
foo = 'asdfasdfzxc<test>afx<one>'
bar = ['asdfasdfzxc','test','afx','one']
答案 0 :(得分:2)
尝试,
SQL
答案 1 :(得分:1)
试试这个
foo = 'asdfasdfzxc<test>afx<one>' bar= foo.replace('<','>').split('>')[:-1] del bar[2]