How to use strconv.QuoteRuneToGraphic() Function in Golang? Last Updated : 05 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a QuoteRuneToGraphic() function which is used to find a single-quoted Go character literal representing the rune. If the rune is not a Unicode graphic character as defined by IsGraphic, then the returned string will use a Go escape sequence (\t, \n, \xFF, \u0100). To access QuoteRuneToGraphic() function you need to import strconv Package in your program with the help of import keyword. Syntax: func QuoteRuneToGraphic(rn rune) string Parameter: This function takes one parameter of rune type, i.e., rn. Return value: This function returns a single-quoted Go string literal which represents rune. Let us discuss this concept with the help of the given examples: Example 1: // Golang program to illustrate // strconv.QuoteRuneToGraphic() Function package main import ( "fmt" "strconv" ) func main() { // Finding a single-quoted Go // string literal representing rune // Using func QuoteRuneToGraphic() function str := strconv.QuoteRuneToGraphic('♥') fmt.Println (str) } Output: '♥' Example 2: // Golang program to illustrate // strconv.QuoteRuneToGraphic() Function package main import ( "fmt" "strconv" ) func main() { // Finding a single-quoted Go // string literal representing rune // Using QuoteRuneToGraphic() function val1 := strconv.QuoteRuneToGraphic('®') fmt.Println("Result 1: ", val1) val2 := strconv.QuoteRuneToGraphic('\u2666') fmt.Println("Result 2: ", val2) val3 := strconv.QuoteRuneToGraphic('\u000a') fmt.Println("Result 3: ", val3) } Output: Result 1: '®' Result 2: '♦' Result 3: '\n' Comment More infoAdvertise with us Next Article How to use strconv.QuoteToGraphic() Function in Golang? A ankita_saini Follow Improve Article Tags : Go Language Golang-strconv Similar Reads How to use strconv.QuoteToGraphic() Function in Golang? Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a QuoteToGraphic() function which is used to find a double-quoted Go string literal representing str and the returned string leaves Unicode g 2 min read How to use strconv.QuoteRuneToASCII() Function in Golang? Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a QuoteRuneToASCII() function which is used to find a single-quoted Go string literal representing rune and the returned string uses Go escap 2 min read How to use strconv.QuoteRune() Function in Golang? Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a QuoteRune() function which is used to find a single-quoted Go string literal representing rune and the returned string uses Go escape seque 2 min read How to use strconv.QuoteToASCII() Function in Golang? Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a QuoteToASCII() function which is used to find a double-quoted Go string literal representing str and the returned string uses Go escape seq 2 min read How to use strconv.Quote() Function in Golang? Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a Quote() function which is used to find a double-quoted Go string literal representing str and the returned string uses Go escape sequences 2 min read How to use strconv.IsGraphic() Function in Golang? Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an IsGraphic() function which is used to check whether the rune is defined as a Graphic by Unicode or not. Such type of characters includes l 2 min read Like