string = <<MARKER
I don't have to "worry" about escaping!!'"!!
MARKER
MARKER delineates the start/end of the string. start string on the next line after opening the heredoc, then end the string by using the delineator again on it's own line.
这将完成所需的所有转义操作,并将其转换为双引号字符串:
string
=> "I don't have to \"worry\" about escaping!!'\"!!\n"