eql?(p1)
public
Two strings are equal if the have the same length and content.
Show source
static VALUE
rb_str_eql(VALUE str1, VALUE str2)
{
if (TYPE(str2) != T_STRING || RSTRING_LEN(str1) != RSTRING_LEN(str2))
return Qfalse;
if (!rb_str_comparable(str1, str2)) return Qfalse;
if (memcmp(RSTRING_PTR(str1), RSTRING_PTR(str2),
lesser(RSTRING_LEN(str1), RSTRING_LEN(str2))) == 0)
return Qtrue;
return Qfalse;
}