Go Program to Print Last Character in a String

Write a Go Program to Print the Last Character in a String. We use the string index position to access the last character. Here, strLastChar[len(strLastChar) – 1] returns the Last character in a given string strLastChar. package main import “fmt” func main() { var strLastChar string strLastChar = “Tutorial Gateway” fmt.Println(strLastChar) LastChar := strLastChar[len(strLastChar)-1] fmt.Printf(“The … Read more