golang string starts with code example
Example 1: golang check string ends with
strings.HasSuffix("How are you?", "?") // true
Example 2: Check string prefix golang
import (
"strings"
)
myString := "x-test"
result := strings.HasPrefix(s1, "x-")