Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Length of string in Go

Length of string is the count of characters present in the string. len() function provided by go lang can be used to calculate length of the string.

Example : How to get length of string in Go lang
package main

import (
    "fmt"
)

func main() {

    myString := "Hello world!"

    myStringLength := len(myString) // returns length of a string
    fmt.Printf("Length of the string : %d\n", myStringLength)
}


Output
Length of the string : 12