Search⌘ K
AI Features

Puzzle 5 Explanation: Raw Strings

Explore how raw strings work in Go by running example code and understanding their difference from interpreted strings. Learn when to use raw strings, especially for multiline text and literal backslashes, and enhance your grasp of Go string handling to write clearer code.

We'll cover the following...

Try it yourself

Try running the code below to see the result for yourself.

Go (1.16.5)
package main
import (
"fmt"
)
func main() {
s := `a\tb`
fmt.Println(s)
}

Explanation

There are two different ways to represent string ...