
June 26th, 2009, 03:43 PM
|
|
Registered User
|
|
Join Date: Jun 2009
Posts: 5
Time spent in forums: 1 h 49 m 5 sec
Reputation Power: 0
|
|
|
Concatenation problem
Newbie question. I have a text file with a bunch of urls that look, let's say, like this:
yahoo/Business_%26_Finance/Stocks_A/index.html
I need to add a "prefix" and "suffix" so was doing this:
datafile.readlines.each {|url|
companyURL = "http://".concat(url.to_s).concat("?off=1")
puts companyURL
}
But the result has a line break in it before the "suffix"
http://yahoo/Business_%26_Finance/Stocks_A/index.html
?off=1
How do I get it to concatenate into one line?
TIA
|