package main
import "fmt"
func main() {
str := "some val!"
fmt.Println(str[5:7])
}
package main
- default package declarationfunc main() {
- declaremain
function that will be launched automatically"some val!"
- sample stringstr[5:7]
- extracts substring from position5
and ends on position7
(2-character string as a result)
group: substring
package main
import "fmt"
func main() {
str := "some val!"
fmt.Println(str[5:7])
}
va