Gaaker Go

Golang Escaped characters

The escape characters of the string are:

Newline character (\n)
Means line break
Carriage return (\r)
Represents a carriage return
Tab character (\t)
Represents a tab character, which can usually be used for typesetting.
Unicode characters (\u or \U)
Represents Unicode characters, such as \u0067
Backslash itself (\)
Where you need to output a backslash, add a backslash before the backslash to output the backslash itself.

The following is a complete code example.

package main

import "fmt"

func main() {
    fmt.Println("is a value type,\nand the value\t is immutable.")

Below is the program output:

is a value type,
and the value    is immutable.
< Escaped characters Escaped characters >