[FRPythoneers] Question about string.join method
J. Wayde Allen
wallen at its.bldrdoc.gov
Mon Apr 30 16:24:55 MDT 2001
On Mon, 30 Apr 2001 jafo at tummy.com wrote:
> intervening occurences of sep. Sep defaults to a single
> (join and joinfields are synonymous)
Yes, this much I had figured out.
> In this case, "list" as the argument is kind of mis-leading. It actually
> takes a sequence. A list is a sequence, but so is a string.
This is what I got wrong.
> Your original "field + field" was correct. It can also be written
> res = '%s%s' % ( field, field )
> res = string.join(( field, field ), '')
OK I see that now. Wouldn't have thought about the
res = '%s%s' % (field, field )
one though. Is there any particular advantage to one of these methods
over any other?
(wallen at its.bldrdoc.gov)
More information about the FRPythoneers