I have a string variable in Ruby as follows:
puts $varString.class
puts "##########"
puts $varString
the output of the code above is:
String
##########
my::FIrst::Line
this id second line
sjdf kjsdfh jsdf
djsf sdk fxdj
I need to get only the first line from the string variable (e.g. my::FIrst::Line).
How can I get it?
As a side note, avoid to use global (the
$sign) variables.