[Tutor] String Tokenizer - As in Java

Marc Barry marc_barry at hotmail.com
Tue Aug 19 10:56:19 EDT 2003


Thanks for the help.

I tried to google for it also and I didn't find those two links.  The second 
one gave me the answer I was looking for as it seems that 'split' does 
exactly what I want.

Although, my interpretation is that 'split' only only allows the defintion 
of one separator.  This is okay for most things, but I have strings that I 
would like to split with two separators such as '.' and '@'.  I don't think 
that I can use split to handle this and therefore will have to resort to 
something more powerful (i.e. regular expressions).

Thanks for your quick and easy answer.

Marc




From: Abel Daniel <abli at freemail.hu>
To: Marc Barry <marc_barry at hotmail.com>
CC: tutor at python.org
Subject: Re: [Tutor] String Tokenizer - As in Java
Date: Tue, 19 Aug 2003 14:16:30 +0200

 > I was wondering if there is a module similar to Java's StringTokenizer in
 > Python?  It is not that difficult to write such a module in pure Python,
 > but I thought I would check here first to see if it has already been done
 > and more importantly tested.

I don't know anything about Java, but  quick googling turned up the 
following
two links:

http://lists.free.net.ph/pipermail/python/2002-February/000115.html
(follow the "Next message" links at the bottom for the full thread)

http://groups.google.com/groups?th=aa5c620fe2b75a8e
(this one is a thread from comp.lang.python, from 2003-07-24, so I doubt
you will find anything better)

Abel Daniel

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail




More information about the Tutor mailing list