Created
May 12, 2016 10:43
-
-
Save roylee0704/f38bfa5b8c7b87e61f860be5f1540766 to your computer and use it in GitHub Desktop.
strings comparison snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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