9951 explained code solutions for 126 technologies


golangHow to get single character substring from string


package main
import "fmt"
func main() {
  str := "some val!"
  fmt.Println(string(str[6]))
}ctrl + c
package main

default package declaration

func main() {

declare main function that will be launched automatically

"some val!"

sample string

str[6]

gets single character from position 6 of the string

string(

convert given variable to string