Forum: Ruby format string to hex

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
85aee9c7dafe273b8f5e57dd587c561f?d=identicon&s=25 Rubt Test (rubytest)
on 2007-04-08 14:33
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
C06869c119472a139eb163b72040b0db?d=identicon&s=25 Bertram Scharpf (Guest)
on 2007-04-08 14:52
(Received via mailing list)
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
This topic is locked and can not be replied to.