From: Paul Irofti Date: 2007-11-08T22:30:10+09:00 Subject: Re: Buffer to string On 2007-11-08, Jari Williamsson wrote: > I have a buffer (stored in a String class) with a NULL-terminated > C-style string inside, what's the most efficient approach to get that > text string up to the NULL? $ irb irb(main):001:0> s = "hello\0" => "hello\000" irb(main):002:0> s.chomp("\0") => "hello" irb(main):003:0> See String#chomp(!) for more details. -- everything is simple, we're stupid contact at gmail