Now that you got a couple answers why your comparisons didn't work, time to suggest a better method. class String def variantes count "2X" end end