Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lbvf50mobile/65298c689e2f2b850aa6ad8bd7b61717 to your computer and use it in GitHub Desktop.
Save lbvf50mobile/65298c689e2f2b850aa6ad8bd7b61717 to your computer and use it in GitHub Desktop.
Go: check if a string starts with a substring #golang
package main
import (
"strings"
)
func main() {
strings.HasPrefix("foobar", "foo") // true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment