Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns true if object has the same length and content; as self; false otherwise:
s = 'foo'
s.eql?('foo') # => true
s.eql?('food') # => false
s.eql?('FOO') # => false
Returns false if the two strings' encodings are not compatible:
"\u{e4 f6 fc}".encode("ISO-8859-1").eql?("\u{c4 d6 dc}") # => false
rb_str_eql(VALUE str1, VALUE str2)
    if (str1 == str2) return Qtrue;
    if (!RB_TYPE_P(str2, T_STRING)) return Qfalse;
    return rb_str_eql_internal(str1, str2);

Was this page useful?