Standard library / strconv
strconv.QuoteRune()
Returns a single-quoted Go rune literal; invalid rune values are represented as the replacement rune. Expected stdout: "'\\n'\n".
Formal Syntax & Structure
go syntaxgo
func QuoteRune(r rune) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| r | rune | Unicode code point to inspect or quote. |
Return Value
string
Encoded representation.
Working Example
Example Snippetgo
package main
import ( "fmt" "strconv")
func main() { fmt.Println(strconv.QuoteRune('\n'))}