[MacRuby-devel] String functions not working in 3/17/2010 build

Robert Rice rice.audio at pobox.com
Wed Mar 17 20:07:37 PDT 2010


Hi group:

UTF-8 default is working again in 3/17 build but I have new problems with strings:

Given:
	def reportDate
		return nil if @calendar.nil?
		
		desc = @calendar.dateValue.description
		desc.slice(0..3) + desc.slice(5..6) + desc.slice(8..9)
	end

	puts "rptdate #{reportDate}"

I get:
2010-03-17 23:03:32.320 MacRuby 0.5[1594:a0f] undefined method `slice' for #<String:0x2022a9c40>


Given:
	def reportDate
		return nil if @calendar.nil?
		
		desc = @calendar.dateValue.description.to_s
		desc.slice(0..3) + desc.slice(5..6) + desc.slice(8..9)
	end

	puts "rptdate #{reportDate()}"

I get: rptdate #<Stin:0

@calendar is linked to a Date Selector object.

Thanks,
Bob Rice

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20100317/9b711bf4/attachment-0001.html>


More information about the MacRuby-devel mailing list