version 1.54, 2019/10/26 09:51:48 |
version 1.55, 2019/10/26 11:43:36 |
Line 82 func containsStr(slice []string, s strin |
|
Line 82 func containsStr(slice []string, s strin |
|
return false |
return false |
} |
} |
|
|
|
func mapStr(slice []string, fn func(s string) string) []string { |
|
result := make([]string, len(slice)) |
|
for i, str := range slice { |
|
result[i] = fn(str) |
|
} |
|
return result |
|
} |
|
|
// intern returns an independent copy of the given string. |
// intern returns an independent copy of the given string. |
// |
// |
// It should be called when only a small substring of a large string |
// It should be called when only a small substring of a large string |