format string to hex

Discussion in 'Ruby' started by Rubt Test, Apr 8, 2007.

  1. Rubt Test

    Rubt Test Guest

    hello,boys
    I have a problem,I want to format the string to hex ,just like format
    abc to
    0x616263 ,but I don't know how to do it ,
    Can you help me,and give me a code?

    thx

    --
    Posted via http://www.ruby-forum.com/.
    Rubt Test, Apr 8, 2007
    #1
    1. Advertising

  2. Hi,

    Am Sonntag, 08. Apr 2007, 21:33:14 +0900 schrieb Rubt Test:
    > I want to format the string to hex ,just like format
    > abc to
    > 0x616263 ,but I don't know how to do it ,


    "abc".unpack "H*"

    Bertram

    --
    Bertram Scharpf
    Stuttgart, Deutschland/Germany
    http://www.bertram-scharpf.de
    Bertram Scharpf, Apr 8, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    6,109
    Neredbojias
    Aug 19, 2005
  2. Bengt Richter
    Replies:
    6
    Views:
    438
    Juha Autero
    Aug 19, 2003
  3. jack
    Replies:
    4
    Views:
    565
  4. tim

    hex string to hex value

    tim, Nov 22, 2005, in forum: Python
    Replies:
    8
    Views:
    18,758
  5. tim
    Replies:
    2
    Views:
    1,522
    Dennis Lee Bieber
    Nov 23, 2005
Loading...

Share This Page