Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Fiddle::Pointer#to_s

to_s(p1 = v1)
Example
ptr.to_s        => string
ptr.to_s(len)   => string

Returns the pointer contents as a string.

When called with no arguments, this method will return the contents until the first NULL byte.

When called with len, a string of len bytes will be returned.

See to_str

See also #to_int #to_str #to_i #to_value also in 3.4 · 3.3 · 3.2 · 3.0