Skip to content
Related Articles

Related Articles

Join an array of strings into a single string in Julia – join() Method
  • Last Updated : 23 Feb, 2021
GeeksforGeeks - Summer Carnival Banner

The join() is an inbuilt function in julia that is used to join an array of strings into a single string. The specified delimiter is used to insert in between the returned strings.
 

Syntax: 

join([io::IO, ] strings, delim, last) 

Parameters: 

  • [io::IO, ] strings: Specified string.
  • delim: Specified delimiter.
  • last: If last is given then this last parameter is inserted in between the last two strings.

Returns: It returns a new single string. 
 
Example 1: 

Python






# Julia program to illustrate
# the use of String join() method
 
# Joining an array of strings into a single string.
println(join(["Geeks", "for", "Geeks"]))
println(join(["Geeks", "for", "Geeks"], "-"))
println(join(["Geeks", "for", "Geeks"], "+"))
println(join(["Geeks", "for", "Geeks"], "-", "+"))
println(join(["Geeks", "for", "Geeks", "is", "CSE", "portal"], "-", "+"))

Output:  

GeeksforGeeks
Geeks-for-Geeks
Geeks+for+Geeks
Geeks-for+Geeks
Geeks-for-Geeks-is-CSE+portal

Example 2: 

Python




# Julia program to illustrate
# the use of String join() method
 
# Joining an array of strings into a single string.
println(join(["1", "2", "3"]))
println(join(["1", "2", "3"], "-"))
println(join(["1", "2", "3"], "+"))
println(join(["1", "2", "3"], "-", "+"))
println(join(["1", "2", "3", "4", "5", "6"], "-", "+"))

Output:  

123
1-2-3
1+2+3
1-2+3
1-2-3-4-5+6

 

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :