I have two strings that appear equal:
context = "Marriott International World’s Most ADMIRED Lodging Company by FORTUNE for 14th yr. via @FortuneMagazine http://cnnmon.ie/1kcFZSQ"
slice_str = context.slice(105,24) # => "http://cnnmon.ie/1kcFZSQ"
str = "http://cnnmon.ie/1kcFZSQ"
slice_str == str # => true
slice_str.eql? str # => true
But when I look up values in a hash where the keys are the strings, they do not return the same thing in Ruby 2.1.0 and Ruby 2.1.1:
redirects = {"http://cnnmon.ie/1kcFZSQ"=>""}
redirects.key?(slice_str) # => false
redirects.key?(str) # => true
What explanation is there for this behaviour? Ruby 1.9.3 works as expected.