Convert a rune to a string in Go

This is an example Go program which demonstrates converting a rune (a single Unicode character) to a string.

package main

import (

func main() {
        var r rune
        var s string
        r = '月'
        s = fmt.Sprintf("%c", r)


The output of the example looks like this:

Copyright © Ben Bullock 2009-2024. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( or use the discussion group at Google Groups. / Privacy / Disclaimer