Raw strings

This is an example Go program illustrating the use of raw strings.

package main

import (
        "fmt"
)

func main() {
        raw := `A raw string can contain backslashes, '\', quotes '"', but not backticks.`
        fmt.Println(raw)
        rawback := `You can include backticks like `+"`"+` this`
        fmt.Println(rawback)
}

(download)

The output of the example looks like this:

A raw string can contain backslashes, '\', quotes '"', but not backticks.
You can include backticks like ` this


Copyright © Ben Bullock 2009-2019. All rights reserved. For comments, questions, and corrections, please email Ben Bullock (benkasminbullock@gmail.com) or use the discussion group at Google Groups. / Privacy / Disclaimer