Matching a constant string at beginning
Fred L. Drake, Jr.
fdrake at acm.org
Thu Dec 23 08:59:01 EST 1999
More information about the Python-list mailing list
Thu Dec 23 08:59:01 EST 1999
- Previous message (by thread): [PSA MEMBERS] Re: Please test new dynamic load behavior
- Next message (by thread): Matching a constant string at beginning
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
François Pinard writes:
> is rather tedious. Of course, I could write a very small function to
> match a constant string at the beginning of another, but there just must
> be some idiom for doing this.
François,
Another possibility, if you're willing to use the CVS version(!), is
to use the string methods:
s = some string...
if s.startswith("Simpsons"):
do something interesting...
Or you could write that annoying little function while waiting for
1.6. ;)
-Fred
--
Fred L. Drake, Jr. <fdrake at acm.org>
Corporation for National Research Initiatives
- Previous message (by thread): [PSA MEMBERS] Re: Please test new dynamic load behavior
- Next message (by thread): Matching a constant string at beginning
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list