~Onlooker 2011-10-28 18:44 采纳率: 33.3%
浏览 458
已采纳

如何在 Go 中编写多行字符串?

Does Go have anything similar to the python's multiline strings:

"""line 1
line 2
line 3"""

If not, what is the preferred way of writing strings spanning multiple lines?

转载于:https://stackoverflow.com/questions/7933460/how-do-you-write-multiline-strings-in-go

  • 写回答

8条回答 默认 最新

  • 笑故挽风 2011-10-28 18:46
    关注

    According to the language specification you can use a raw string literal, where the string is delimited by backticks instead of double quotes.

    `line 1
    line 2
    line 3`
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?