Sha256: f60295d82f18ade4133037ed93753fb51dc93e0f185880f29d6145e63dd6edd5

Contents?: true

Size: 236 Bytes

Versions: 13

Compression:

Stored size: 236 Bytes

Contents

Get the bytes of a String:

    "hello".bytes
    # => [104, 101, 108, 108, 111]

Get a byte from a String:

    str = "hello"
    str.getbyte(0)
    # => 104

Sets a byte in a String:

    str.setbyte(0,0x41)
    str
    # => "Aello"

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ronin-2.1.0 data/tips/ruby/string_bytes.txt
ronin-2.1.0.rc1 data/tips/ruby/string_bytes.txt
ronin-2.0.5 data/tips/ruby/string_bytes.txt
ronin-2.0.4 data/tips/ruby/string_bytes.txt
ronin-2.0.3 data/tips/ruby/string_bytes.txt
ronin-2.0.2 data/tips/ruby/string_bytes.txt
ronin-2.0.1 data/tips/ruby/string_bytes.txt
ronin-2.0.0 data/tips/ruby/string_bytes.txt
ronin-2.0.0.beta5 data/tips/ruby/string_bytes.txt
ronin-2.0.0.beta4 data/tips/ruby/string_bytes.txt
ronin-2.0.0.beta3 data/tips/ruby/string_bytes.txt
ronin-2.0.0.beta2 data/tips/ruby/string_bytes.txt
ronin-2.0.0.beta1 data/tips/ruby/string_bytes.txt