[FRPythoneers] Question about string.join method

J. Wayde Allen wallen at its.bldrdoc.gov
Mon Apr 30 16:19:54 MDT 2001

On Mon, 30 Apr 2001, PC Drew wrote:

> string.join actually joins strings together based on a third delimiter:
> string.join(('192', '168', '2', '2'), '.')
> would produce a valid ip address of:
> ''
> You sent it a string, and since python thinks of strings as arrays of 
> chars, it joined every letter in the string with the contents of field[3].

Aha!  It was pretty obvious that this was the behaviour I was seeing, but
I was having trouble finding a good reference to the syntax for the
string.join method.  If I change the line to:

   self.latitude = string.join((field[2], field[3])," ")

or even

   self.latitude = string.join((field[2], field[3]))

I get the behavior I was expecting.


- Wayde
  (wallen at its.bldrdoc.gov)

More information about the FRPythoneers mailing list