From: Zqd Zqd Date: 2008-09-07T16:37:06+09:00 Subject: Re: how to change ASCI to Hex thanks for answering my ruby version is 1.8.6 well,when i receive and print,it it ""0@\002\001\000\004\006public\2443\006\006+\006\001\004\001\t@\004\300\250\313\031\002\001\006\002\001*C\002090\0310\027\006\b+\006\001\002\001\001\005\000\004\vSystem Name\n"" how can i print it in Hex? arton wrote: > --------------------------------- Joel VanderWerf > vjoel@path.berkeley.edu > vjoel@path.berkeley.edu, ruby-talk@ruby-lang.org (ruby-talk ML) > how to change ASCI to Hex >> >>> server = UDPSocket.open >> > because str[n] returns just one character at the index points >> >> Anyway, I'm guessing the next question will be "how do I get a long from >> positions 3..7?", and so might as well get started using unpack.... > > you may see the version invoking ruby with -v option > ie) > c:\>ruby -v > ruby 1.9.0 (2008-08-26 revision 18849) [i386-mswin32] > >> I'm guessing the next question will be "how do I get a long from >> positions 3..7?", and so might as well get started using unpack.. > Um, you are correct. I respect you. -- Posted via http://www.ruby-forum.com/.