Is string.bytesize not available in ruby1.8.6

Hi
I am using ruby1.8.6 and tried
“something”.bytesize it gives error
undefined method `bytesize’ for #String:0x41f8c98

But in ruby1.8.7 it is working as expected

Thanks

Well…then there’s your answer. :frowning:

puts RUBY_VERSION
puts ‘str’.bytesize

–output:–
1.8.6
Line 2: undefined method `bytesize’ for “str”:String (NoMethodError)

–output:–
1.8.7
3

–output:–
1.9.2
3