Tuesday, March 21, 2017

Ruby:- How to get the output in same line in ruby

you can try using chomp . for example

 variable=`linux`
 variable1=technotes
 output=#{variable} #{variable1}
 output =linux
 technotes

 To get in same line
 variable=`hi`.chomp
 variable=`linux`.chomp
 output=#{variable} #{variable1}
 output =linux technotes

No comments:

Post a Comment