From: Jason Mcdonald Date: 2011-01-13T11:19:49+09:00 Subject: Weird error using String#[] Please check out the attached file. I am writing a script to notify me when a few select items become available. It hits a web page then parses the information in order to determine whether the item is available or not. When I parse the values out I start seeing some really weird results when calling the String#[]. What is even weirder is that when I put these results with something like puts "val: #{weird_val}" it also replaces part of the string being put, "val: ". Example: ret = res[spos, 90] puts "ret: #{ret}" # ^^^^^ # Expected live result (works in baseline): # ret: id="ProdAvailability">Availability:Ou # # Actual live result (missing Ou on end, r in pos 0 replaced with O): # Oet: id="ProdAvailability">Availability: If I pull the contents from the web site, it doesn't work. If I pull the contents from a string saved in the script (denoted as baseline in the file), it works fine. I have been spinning my wheels for 2 days now and am pretty sure that I am overlooking something obvious. Anyone have any idea what is causing this? Attachments: http://www.ruby-forum.com/attachment/5731/availability_watcher.rb -- Posted via http://www.ruby-forum.com/.