From: Sean Russell Date: 2002-05-05T23:32:41+09:00 Subject: Re: Advice on Memory Related Performance Tuning Hi Bob, I can't answer most of your questions, but I can help you with the last: Bob Hutchison wrote: > While playing around with this I thought of using an array to store the > characters and then convert that to a string when necessary. > > Q3. How do you convert between an array of characters/fixnums and strings? Array.pack() and String.unpack(). If you're converting ISO-8859-1 text, use "C*" as the parameter to pack() and unpack(). If you're doing UTF-8, use "U*". array = 'sean'.unpack('C*') string = array.pack('C*') Check your favorite Ruby book for more options to pack() and unpack(). It is a handy method, and fairly fast, although I'm not sure it would save you much in the way of object allocation time. --- SER