package main
import (
"fmt"
"strings"
)
func main() {
s1 := "laptop"
s2 := "la"
s3 := "top"
s4 := "ap"
result1 := strings.HasPrefix(s1, s2)
fmt.Println("result 1: ", result1)
result2 := strings.HasSuffix(s1, s3)
fmt.Println("result 2: ", result2)
result3 := strings.Contains(s1, s4)
fmt.Println("result 3: ", result3)
}
Output
result 1: true
result 2: true
result 3: true