From: Florian Frank Date: 2004-03-29T08:55:12+09:00 Subject: Re: [newbie] What is String#dump for? On Mon, 2004-03-29 at 00:02, =?koi8-r?Q?=22?=Alexey Verhovsky=?koi8-r?Q?=22=20?= wrote: > Given that I can rewrite your "usage example" like this: > > _="puts'_='+_.dump+';'+_";puts'_='+_.dump+';'+_ > > , String#dump must be the same thing as String#inspect, > and has nothing to do with marshalling. Correct? It's not the same method as inspect, but similar. There is also a Marshal.dump method, but String#dump has nothing to do with such militaristic endeavours. > I would still appreciate some reallife usage. One good use of dump is for debugging of network streams. If you ouput arbitrary binary data on your terminal strange things can happen, so it's better to escape the dangerous characters before doing that.