How to print rune in golang?

Hi Friends πŸ‘‹,

Welcome To aGuideHub! ❀️

Today, we will learn to create and print rune in golang, before going to the example we have to understand

What is a rune in goLang?

A rune is an int32 value, and therefore it is a Go type that is used for representing a Unicode code point. A Unicode code point or code position is a numerical value that is usually used for representing single Unicode characters;

For example, the rune literal β€˜a’ is actually the number 97.

So let’s create a rune variable and print it in golang console.

package main
import "fmt"

func main() {
  r := []rune("abc");

In the above code, we are create rune variable with value of abc and when print it so [97 98 99] in unicode of there char.

print, rune, golang

Try it yourself

All the best πŸ‘