split

Fredrik Lundh fredrik at pythonware.com
Tue May 8 12:33:36 EDT 2001


Martin Johansson wrote:
> I have a string s that contains "( 7 Maj 21:58)"
> and i want to save 7 Maj in a variable named date.
> But I dont understand what I suppose to write in the split method.
> date = string.split(s, "( ", ")")

what's wrong with

    date = string.strip(s[1:-1])

Cheers /F





More information about the Python-list mailing list