We know
require 'pp'
a=["value1", "value2", "value3"]
pp a
pretty prints the array as an output to the console. How do I get that pretty output into a string (a string containing the newlines that makes things pretty, etc.)?
...purpose being to return that pretty string from a method.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…