You are here : python_2stringstringjoin

string.join() - string

             

The method join() returns a string in which the string elements of sequence have been joined by str separator.


  • sequence -- This is a sequence of the elements to be joined.


Syntax

str.join(sequence)


Example

#!/usr/bin/python

s = "-";
seq = ("a", "b", "c"); # This is sequence of strings.
print s.join( seq )


Output / Return Value

When we run above program, it produces following result −


a-b-c


Limitations


Alternatives / See Also


Reference