Question

Suppose I have a string "this\n\tis \"helpful\"" and I'd like it to be displayed in the terminal, unescaped, for copy/paste reasons, i.e.

this
  is "helpful"

Is this possible in terminal, either in IRB or otherwise?

Was it helpful?

Solution

11:15:14lasto1.9.3 ~/clients  🐤  irb
1.9.3-p448 :001 > s = "this\n\tis \"helpful\""
 => "this\n\tis \"helpful\""
1.9.3-p448 :002 > puts s
this
    is "helpful"
 => nil
1.9.3-p448 :003 >
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top