C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
And: We specify a semicolon delimiter. The string values are merged into a single string, with a semicolon between each pair.
Ruby program that uses join
values = ["keyboard", "monitor", "CPU"]
# Use the join method to combine a string array.
joined = values.join(";")
puts joined
Output
keyboard;monitor;CPU
Ruby program that uses no delimiter
values = ["a", "b", "c"]
# Join with no delimiter.
# ... This turns an array of characters into a string.
result = values.join
puts result
Output
abc