PATH:
opt
/
alt
/
ruby18
/
share
/
ri
/
1.8
/
system
/
String
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Decodes <em>str</em> (which may contain binary data) according to the format string, returning an array of each value extracted. The format string consists of a sequence of single-character directives, summarized in the table at the end of this entry. Each directive may be followed by a number, indicating the number of times to repeat with this directive. An asterisk (``<tt>*</tt>'') will use up all remaining elements. The directives <tt>sSiIlL</tt> may each be followed by an underscore (``<tt>_</tt>'') to use the underlying platform's native size for the specified type; otherwise, it uses a platform-independent consistent size. Spaces are ignored in the format string. See also <tt>Array#pack</tt>. - !ruby/struct:SM::Flow::VERB body: " "abc \\0\\0abc \\0\\0".unpack('A6Z6') #=> ["abc", "abc "]\n "abc \\0\\0".unpack('a3a3') #=> ["abc", " \\000\\000"]\n "abc \\0abc \\0".unpack('Z*Z*') #=> ["abc ", "abc "]\n "aa".unpack('b8B8') #=> ["10000110", "01100001"]\n "aaa".unpack('h2H2c') #=> ["16", "61", 97]\n "\\xfe\\xff\\xfe\\xff".unpack('sS') #=> [-2, 65534]\n "now=20is".unpack('M*') #=> ["now is"]\n "whole".unpack('xax2aX2aX1aX2a') #=> ["h", "e", "l", "l", "o"]\n" - !ruby/struct:SM::Flow::P body: This table summarizes the various formats and the Ruby classes returned by each. - !ruby/struct:SM::Flow::VERB body: " Format | Returns | Function\n -------+---------+-----------------------------------------\n A | String | with trailing nulls and spaces removed\n -------+---------+-----------------------------------------\n a | String | string\n -------+---------+-----------------------------------------\n B | String | extract bits from each character (msb first)\n -------+---------+-----------------------------------------\n b | String | extract bits from each character (lsb first)\n -------+---------+-----------------------------------------\n C | Fixnum | extract a character as an unsigned integer\n -------+---------+-----------------------------------------\n c | Fixnum | extract a character as an integer\n -------+---------+-----------------------------------------\n d,D | Float | treat sizeof(double) characters as\n | | a native double\n -------+---------+-----------------------------------------\n E | Float | treat sizeof(double) characters as\n | | a double in little-endian byte order\n -------+---------+-----------------------------------------\n e | Float | treat sizeof(float) characters as\n | | a float in little-endian byte order\n -------+---------+-----------------------------------------\n f,F | Float | treat sizeof(float) characters as\n | | a native float\n -------+---------+-----------------------------------------\n G | Float | treat sizeof(double) characters as\n | | a double in network byte order\n -------+---------+-----------------------------------------\n g | Float | treat sizeof(float) characters as a\n | | float in network byte order\n -------+---------+-----------------------------------------\n H | String | extract hex nibbles from each character\n | | (most significant first)\n -------+---------+-----------------------------------------\n h | String | extract hex nibbles from each character\n | | (least significant first)\n -------+---------+-----------------------------------------\n I | Integer | treat sizeof(int) (modified by _)\n | | successive characters as an unsigned\n | | native integer\n -------+---------+-----------------------------------------\n i | Integer | treat sizeof(int) (modified by _)\n | | successive characters as a signed\n | | native integer\n -------+---------+-----------------------------------------\n L | Integer | treat four (modified by _) successive\n | | characters as an unsigned native\n | | long integer\n -------+---------+-----------------------------------------\n l | Integer | treat four (modified by _) successive\n | | characters as a signed native\n | | long integer\n -------+---------+-----------------------------------------\n M | String | quoted-printable\n -------+---------+-----------------------------------------\n m | String | base64-encoded\n -------+---------+-----------------------------------------\n N | Integer | treat four characters as an unsigned\n | | long in network byte order\n -------+---------+-----------------------------------------\n n | Fixnum | treat two characters as an unsigned\n | | short in network byte order\n -------+---------+-----------------------------------------\n P | String | treat sizeof(char *) characters as a\n | | pointer, and return \\emph{len} characters\n | | from the referenced location\n -------+---------+-----------------------------------------\n p | String | treat sizeof(char *) characters as a\n | | pointer to a null-terminated string\n -------+---------+-----------------------------------------\n Q | Integer | treat 8 characters as an unsigned\n | | quad word (64 bits)\n -------+---------+-----------------------------------------\n q | Integer | treat 8 characters as a signed\n | | quad word (64 bits)\n -------+---------+-----------------------------------------\n S | Fixnum | treat two (different if _ used)\n | | successive characters as an unsigned\n | | short in native byte order\n -------+---------+-----------------------------------------\n s | Fixnum | Treat two (different if _ used)\n | | successive characters as a signed short\n | | in native byte order\n -------+---------+-----------------------------------------\n U | Integer | UTF-8 characters as unsigned integers\n -------+---------+-----------------------------------------\n u | String | UU-encoded\n -------+---------+-----------------------------------------\n V | Fixnum | treat four characters as an unsigned\n | | long in little-endian byte order\n -------+---------+-----------------------------------------\n v | Fixnum | treat two characters as an unsigned\n | | short in little-endian byte order\n -------+---------+-----------------------------------------\n w | Integer | BER-compressed integer (see Array.pack)\n -------+---------+-----------------------------------------\n X | --- | skip backward one character\n -------+---------+-----------------------------------------\n x | --- | skip forward one character\n -------+---------+-----------------------------------------\n Z | String | with trailing nulls removed\n | | upto first null with *\n -------+---------+-----------------------------------------\n @ | --- | skip to the offset given by the\n | | length argument\n -------+---------+-----------------------------------------\n" full_name: String#unpack is_singleton: false name: unpack params: | str.unpack(format) => anArray visibility: public
[-] tojis-i.yaml
[edit]
[-] is_complex_yaml%3f-i.yaml
[edit]
[-] chop-i.yaml
[edit]
[-] unpack-i.yaml
[edit]
[-] gsub%21-i.yaml
[edit]
[-] toutf8-i.yaml
[edit]
[-] lstrip%21-i.yaml
[edit]
[-] original_succ-i.yaml
[edit]
[-] %3c%3d%3e-i.yaml
[edit]
[-] size-i.yaml
[edit]
[-] concat-i.yaml
[edit]
[-] upcase%21-i.yaml
[edit]
[-] shellsplit-i.yaml
[edit]
[-] toeuc-i.yaml
[edit]
[-] match-i.yaml
[edit]
[-] tr%21-i.yaml
[edit]
[-] lines-i.yaml
[edit]
[-] mbchar%3f-i.yaml
[edit]
[-] reverse%21-i.yaml
[edit]
[-] %2a-i.yaml
[edit]
[-] swapcase-i.yaml
[edit]
[-] upcase-i.yaml
[edit]
[-] succ%21-i.yaml
[edit]
[-] tr-i.yaml
[edit]
[-] scan-i.yaml
[edit]
[-] ljust-i.yaml
[edit]
[-] jlength-i.yaml
[edit]
[-] dump-i.yaml
[edit]
[-] empty%3f-i.yaml
[edit]
[-] to_yaml-i.yaml
[edit]
[-] partition-i.yaml
[edit]
[-] hex-i.yaml
[edit]
[-] to_str-i.yaml
[edit]
[-] squeeze%21-i.yaml
[edit]
[-] _regex_quote-i.yaml
[edit]
[-] hash-i.yaml
[edit]
[-] delete%21-i.yaml
[edit]
[-] sub%21-i.yaml
[edit]
[-] rpartition-i.yaml
[edit]
[-] tosjis-i.yaml
[edit]
[-] %5b%5d%3d-i.yaml
[edit]
[-] bytesize-i.yaml
[edit]
[-] scanf-i.yaml
[edit]
[-] block_scanf-i.yaml
[edit]
[-] iseuc-i.yaml
[edit]
[-] crypt-i.yaml
[edit]
[-] split-i.yaml
[edit]
[-] sub-i.yaml
[edit]
[-] tr_s-i.yaml
[edit]
[-] chars-i.yaml
[edit]
[-] shellescape-i.yaml
[edit]
[-] casecmp-i.yaml
[edit]
[-] gsub-i.yaml
[edit]
[-] downcase-i.yaml
[edit]
[-] %3c%3c-i.yaml
[edit]
[-] next-i.yaml
[edit]
[-] each_byte-i.yaml
[edit]
[-] index-i.yaml
[edit]
[-] insert-i.yaml
[edit]
[-] expand_ch_hash-i.yaml
[edit]
[-] start_with%3f-i.yaml
[edit]
[-] include%3f-i.yaml
[edit]
[-] rstrip-i.yaml
[edit]
[-] chomp-i.yaml
[edit]
[-] downcase%21-i.yaml
[edit]
[-] oct-i.yaml
[edit]
[-] rstrip%21-i.yaml
[edit]
[-] initialize_copy-i.yaml
[edit]
[-] strip-i.yaml
[edit]
[-] to_f-i.yaml
[edit]
[-] %2b-i.yaml
[edit]
[-] inspect-i.yaml
[edit]
[-] isutf8-i.yaml
[edit]
[-] %3d%7e-i.yaml
[edit]
[-] delete-i.yaml
[edit]
[-] end_with%3f-i.yaml
[edit]
[-] capitalize-i.yaml
[edit]
[-] issjis-i.yaml
[edit]
[-] bytes-i.yaml
[edit]
[-] _expand_ch-i.yaml
[edit]
[-] succ-i.yaml
[edit]
[-] each_line-i.yaml
[edit]
[-] swapcase%21-i.yaml
[edit]
[-] upto-i.yaml
[edit]
[-] squeeze-i.yaml
[edit]
[-] kconv-i.yaml
[edit]
[-] %3d%3d-i.yaml
[edit]
[-] rindex-i.yaml
[edit]
[-] %5b%5d-i.yaml
[edit]
[-] chop%21-i.yaml
[edit]
[-] %25-i.yaml
[edit]
[-] end_regexp-i.yaml
[edit]
[-] strip%21-i.yaml
[edit]
[-] yaml_new-c.yaml
[edit]
[-] eql%3f-i.yaml
[edit]
[-] length-i.yaml
[edit]
[-] toutf16-i.yaml
[edit]
[+]
..
[-] slice-i.yaml
[edit]
[-] to_i-i.yaml
[edit]
[-] next%21-i.yaml
[edit]
[-] intern-i.yaml
[edit]
[-] is_binary_data%3f-i.yaml
[edit]
[-] jcount-i.yaml
[edit]
[-] each_char-i.yaml
[edit]
[-] each-i.yaml
[edit]
[-] jsize-i.yaml
[edit]
[-] new-c.yaml
[edit]
[-] tr_s%21-i.yaml
[edit]
[-] count-i.yaml
[edit]
[-] original_succ%21-i.yaml
[edit]
[-] cdesc-String.yaml
[edit]
[-] chomp%21-i.yaml
[edit]
[-] to_s-i.yaml
[edit]
[-] center-i.yaml
[edit]
[-] capitalize%21-i.yaml
[edit]
[-] replace-i.yaml
[edit]
[-] to_sym-i.yaml
[edit]
[-] lstrip-i.yaml
[edit]
[-] slice%21-i.yaml
[edit]
[-] rjust-i.yaml
[edit]
[-] sum-i.yaml
[edit]
[-] reverse-i.yaml
[edit]