How to concatenate strings with spaces in Ruby

1 Answer

0 votes
s1 = "java"
s2 = "ruby"
s3 = "python"

s = [s1, s2, s3].join(' ')

puts s

puts s.class



# run:
#   
# java ruby python
# String
#

 



answered Oct 13, 2020 by avibootz

Related questions

...