dsfs21312 2010-12-12 20:48
浏览 142
已采纳

如何在反引号中添加反引号?

is it possible to print back quotes in Go using back quotes : something like this:

package main

import "fmt"

func main() {
    fmt.Println(```) // for example I can do it with double quotes "\""
}
  • 写回答

1条回答 默认 最新

  • drzil26260 2010-12-12 22:49
    关注
    package main
    
    import "fmt"
    
    func main() {
        // back ` quote
        fmt.Println((`back ` + "`" + ` quote`))
    }
    

    Raw string literals are character sequences between back quotes ``. Within the quotes, any character is legal except back quote. The value of a raw string literal is the string composed of the uninterpreted characters between the quotes; in particular, backslashes have no special meaning and the string may span multiple lines. String literals

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?