i want to split a string at each place where 2 different characters might appear.
'some text<some tag>more text'.split2('<','>')
--> ['some text','some tag','more text']
yes, this example is splitting HTML, so that may be a bad example. consider this outside of the scope of HTML so your thinking does not converge on HTMLParser. Maybe it would be nice if str.split could be upgraded to do this like:
'some text<some tag>more text'.split(['<','>'])
'some text<some tag>more text'.split2('<','>')
--> ['some text','some tag','more text']
yes, this example is splitting HTML, so that may be a bad example. consider this outside of the scope of HTML so your thinking does not converge on HTMLParser. Maybe it would be nice if str.split could be upgraded to do this like:
'some text<some tag>more text'.split(['<','>'])
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.