Help for this page

Select Code to Download


  1. or download this
        a  A string with arbitrary binary data, will be null padded.
        A  A text (ASCII) string, will be space padded.
        Z  A null-terminated (ASCIZ) string, will be null padded.
    
  2. or download this
    print length pack '(A2)*', 'fr','ed','x';;
    6
    ...
    
    print unpack 'C*', pack '(Z2)*', 'fr','ed','x';;
    102 0 101 0 120 0  ## Note! the 'r' & 'd' characters have been thrown 
    +away? Another bug?
    
  3. or download this
    printf "'%s'\n", join"'", unpack '(A2)*', 'fredx';;
    'fr'ed'x'
    ...
    
    printf "'%s'\n", join"'", unpack '(Z2)*', 'fredx';;
    'fr'ed'x'