Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How to get a string to print with "special" characters showing asescape sequences, rather than as whitespace etc?

Reply
Thread Tools

How to get a string to print with "special" characters showing asescape sequences, rather than as whitespace etc?

 
 
Kenneth McDonald
Guest
Posts: n/a
 
      09-23-2008
Again, this is for debugging purposes. Thanks for the help.
Ken


 
Reply With Quote
 
 
 
 
Brian Candler
Guest
Posts: n/a
 
      09-24-2008
Kenneth McDonald wrote:
> Again, this is for debugging purposes. Thanks for the help.
> Ken


Do you mean String#inspect?

a = "\007foo\nbar"
puts a.inspect
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Roberto Casadei
Guest
Posts: n/a
 
      09-24-2008
Kenneth McDonald wrote:
> Again, this is for debugging purposes. Thanks for the help.
> Ken


use p()
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: Splitting text at whitespace but keeping the whitespace in thereturned list MRAB Python 3 01-26-2010 11:36 PM
Structure using whitespace vs logical whitespace cmdrrickhunter@yaho.com Python 10 12-16-2008 03:51 PM
Reversible replacement of whitespace characters with visible characters Micah Python 2 06-02-2006 09:55 PM
Whitespace where I don't want whitespace! Oli Filth HTML 9 01-17-2005 08:47 PM



Advertisments