문제

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?

도움이 되었습니까?

해결책

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 >
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top