Go String With Range In Golang

[Solved] Go String With Range In Golang | Go - Code Explorer | yomemimo.com
Question : Go String with range in Golang

Answered by : samer-saeid

// Program using range with string
package main
import ("fmt")
func main() { string := "Golang" fmt.Println("Index: Character") // i access index of each character // item access each character for i, item := range string { fmt.Printf("%d= %c \n", i, item) }
}

Source : | Last Update : Thu, 23 Jun 22

Answers related to go string with range in golang

Code Explorer Popular Question For Go