Standard library / strconv

strconv.QuoteRuneToGraphic()

Returns a single-quoted Go rune literal retaining graphic Unicode runes where possible. Expected stdout: "'é'\n".

Formal Syntax & Structure

go syntaxgo
func QuoteRuneToGraphic(r rune) string

Parameters & Attributes

NameTypeDescription
rruneUnicode 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.QuoteRuneToGraphic('é'))}
Go Reference