21 May
2011
21 May
'11
2:10 a.m.
Hi,
I finally found time to further investigate this. Thanks for investigating it.
Am I doing something wrong? If not, I'll file a ticket. No it's indeed a bug, could you please file a ticket. By the way I've made a shorter version of your code:
framework 'Cocoa' s1 = NSMutableString.stringWithString("this is a test script.") s1.sub!(/test/, "$B$"(B") puts s1 #=> this is a $B!1(IAB(B script. s2 = NSMutableString.stringWithString("this is a test script.") s2[10..14] = "$B$"(B" puts s2 #=> this is a $B!1(IAB(B script. ------- (in fact sub! uses []= internally) Cheers, Vincent