Skip to content

Instantly share code, notes, and snippets.

@roylee0704
Created May 12, 2016 10:43
Show Gist options
  • Save roylee0704/f38bfa5b8c7b87e61f860be5f1540766 to your computer and use it in GitHub Desktop.
Save roylee0704/f38bfa5b8c7b87e61f860be5f1540766 to your computer and use it in GitHub Desktop.
strings comparison snippet
func compare(s, t string) bool {
if len(s) != len(t) {
return false
}
for i := range s {
if s[i] != t[i] {
return false
}
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment