[Tutor] Parsing string with variable length delimiter?

Jeffrey F. Bloss jbloss at alltel.net
Tue Sep 7 18:00:03 CEST 2004


In general, what's the "best" way to split() a series of strings such as...

TEXT      MORETEXT      SOMEMORETEXT  TEXT
MORETEXT  TEXT          MORETEXT      SOMEMORETEXT

Text field lengths are variable as are numbers of delimiter characters. 
mystring.split(' ') yields a list including each individual space. Would it 
be best to parse that list and reject any spaces, or is there a regex way 
to modify the behavior of the .split() method? Or another method all 
together?

Thanks in advance!


More information about the Tutor mailing list