[MacRuby-devel] [MacRuby] #454: String#getbyte not working?

Brian Chapados chapbr at gmail.com
Wed Nov 25 17:44:22 PST 2009


I'm pretty sure you can use NSString#characterAtIndex

s = "Brian"
s.characterAtIndex(0) # => 66

Brian

On Wed, Nov 25, 2009 at 4:46 PM, MacRuby <ruby-noreply at macosforge.org> wrote:
> #454: String#getbyte not working?
> ------------------------------+---------------------------------------------
>  Reporter:  paul@…            |       Owner:  lsansonetti@…
>     Type:  defect            |      Status:  new
>  Priority:  minor             |   Milestone:  MacRuby 0.5
> Component:  MacRuby           |    Keywords:
> ------------------------------+---------------------------------------------
>
> Comment(by paul@…):
>
>  Is String#getbyte on the roadmap somewhere. Given the new multibyte
>  strings in Ruby 1.9, String#getbyte seems to be the only way to get the
>  old behaviour of directly accessing bytes (rather than characters) in a
>  string? OTOH I suppose there would be a Cocoa way to do that?
>
> --
> Ticket URL: <http://www.macruby.org/trac/ticket/454#comment:3>
> MacRuby <http://macruby.org/>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>


More information about the MacRuby-devel mailing list