Golang Get String Length

[Solved] Golang Get String Length | Haskell - Code Explorer | yomemimo.com
Question : golang get string length

Answered by : julianto

package main
import "fmt"
func main() { value := "cat" // Take length of string with len. length := len(value) fmt.Println(length) // Loop over the string with len. for i := 0; i < len(value); i++ { fmt.Println(string(value[i])) }
}

Source : https://www.dotnetperls.com/len-go | Last Update : Wed, 17 Jun 20

Question : Go Find the length of a string

Answered by : samer-saeid

// Program to count the length of a string
package main
import ("fmt")
func main() { // creating string message := "Welcome to Programiz" // using len() function to count length stringLength := len(message) fmt.Println("Length of a string is:", len(stringMessage))
}

Source : | Last Update : Thu, 23 Jun 22

Answers related to golang get string length

Code Explorer Popular Question For Haskell