G
Gani Ruthellen
Given:
lines = file.readlines("\x15") # don't ask
lines.each do |y|
y.chomp!("\x15")
y.sub!(/^\n/,"") #kill off the extra line feeds
if y =~ /^\*\*\*/ then
y = "<someTag>" + y + "</someTag>"
...
[ assume ends]
puts lines
my output for the affected elements is:
<someTag>
value of y</someTag>
How can I get the results to be
<someTag>value of y</someTag>
I've tried changing y to y.to_s; I still get the new line.
I'm sure this is obvious if you know what you're doing, but I'm stumped.
Can somebody give me a clue?
TIA if you take a moment to point me in the right direction.
Gani
lines = file.readlines("\x15") # don't ask
lines.each do |y|
y.chomp!("\x15")
y.sub!(/^\n/,"") #kill off the extra line feeds
if y =~ /^\*\*\*/ then
y = "<someTag>" + y + "</someTag>"
...
[ assume ends]
puts lines
my output for the affected elements is:
<someTag>
value of y</someTag>
How can I get the results to be
<someTag>value of y</someTag>
I've tried changing y to y.to_s; I still get the new line.
I'm sure this is obvious if you know what you're doing, but I'm stumped.
Can somebody give me a clue?
TIA if you take a moment to point me in the right direction.
Gani