Skip to content

Instantly share code, notes, and snippets.

@flaviocopes
Last active November 15, 2021 09:34
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Go: check if a string ends with a substring #golang
package main
import (
"strings"
)
func main() {
strings.HasSuffix("foobar", "bar") // true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment