[Ironruby-core] String Equality Operation

John Lam (DLR) jflam at microsoft.com
Mon Feb 18 10:14:02 EST 2008

Aaron Clauson:

> mystring = $external.MyMethod.to_s
> puts "mystring=#{mystring}."
> if mystring == 'abcd'
>  puts "Match."
> else
>  puts "No match.
> end

If you look at the class of each of your strings you'll find that they are currently different types. mystring should be a ClrString and 'abcd' is a String. If you do mystring.to_s == 'abcd' it should return true.

We're working on a plan to unify all string types and do lazy conversions as necessary. We're slammed doing MIX work so that won't start happening until we're locked down for MIX (at least a couple of weeks or so).


More information about the Ironruby-core mailing list