From: elof@... Date: 2007-11-08T22:13:57+09:00 Subject: Re: Buffer to string Hi One approach could be to use split and a regexp: s = "hi" s << 0.chr s << "there" p s p s.split(/\000/).first Kristian On Thu, 8 Nov 2007 21:24:34 +0900, 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? > > > Best regards, > > Jari Williamsson