how to put a backquote in a backquoted string?

后端 未结 1 1459
轻奢々
轻奢々 2020-12-09 03:11

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

package main

import \"fmt\"

func main() {
    fmt.Println(```) // for ex         


        
相关标签:
1条回答
  • 2020-12-09 04:03
    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

    0 讨论(0)
提交回复
热议问题