Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
String#unpack
unpack(template, offset: 0) → array
pack.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/pack.rb, line 19
def unpack(fmt, offset: 0)
Primitive.pack_unpack(fmt, offset)
end
Extracts data from self, forming objects that become the elements of a new array; returns that array. See Packed Data.
Ruby version changes
-
3.3
-
String#unpacknow raisesArgumentErrorfor unknown directives. [Bug #19150]
-
-
3.1
-
String#unpackandString#unpack1now accept anoffset:keyword argument to start the unpacking after an arbitrary number of bytes have been skipped. Ifoffsetis outside of the string boundsArgumentErroris raised. [Feature #18254]
-
See also
#unicode_normalized?
#unpack1
#unicode_normalize!
#upcase
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0