How to Convert a String to a Rune Slice in Go

Convert a Go string to a rune slice using the built-in []rune() conversion to handle Unicode characters correctly.

Use the built-in []rune() conversion to transform a string into a slice of runes, which correctly handles multi-byte Unicode characters.

s := "hello"
r := []rune(s)

This creates a new slice where each element is a Unicode code point, allowing you to safely manipulate individual characters regardless of their byte length.