Skip to content
instance method

String#unpack1

(::string template, ?offset: ::int) -> (::Integer | ::Float | ::String)?
unpack1(template, offset: 0) → object

Like String#unpack with no block, but unpacks and returns only the first extracted object. See Packed Data.

Related: see Converting to Non-String.

Ruby version changes

  1. 3.1
See also #unpack #upcase #unicode_normalized? #upcase! also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0