Created
December 1, 2022 08:46
-
-
Save teivah/67d573d794cce83d111ebe6ff2395e27 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 concat(values []string) string { | |
total := 0 | |
for i := 0; i < len(values); i++ { | |
total += len(values[i]) | |
} | |
sb := strings.Builder{} | |
sb.Grow(total) | |
for _, value := range values { | |
_, _ = sb.WriteString(value) | |
} | |
return sb.String() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment