[Tutor] understanding join
steve.poe at gmail.com
Thu Jul 31 04:31:24 CEST 2008
> Say I have a sequence seq and a string s, and I call s.join(seq).
> Here's what it does:
> s.join(seq) == seq + s + seq + s + seq + s + ... + seq[-2] +
> s + seq[-1]
> So if you call 'abc'.join('ABC'), you get:
> 'ABC' + 'abc' + 'ABC' + 'abc' + 'ABC'
> which is:
> 'A' + 'abc' + 'B' + 'abc' + 'C'
> Hope this helps.
Your explanation is very help. It does make be wonder the usefulness
of join with strings. Do you have a practical example/situation?
More information about the Tutor