feat: add JoinFunc

This commit is contained in:
dudaodong committed 2024-10-24 14:56:13 +08:00
1 parent 921f218ef7
commit 2015d36b08
5 files changed
+126

No files matched your search

+11
View File
@@ -1261,3 +1261,14 @@ func ExampleFrequency() {
// Output:
// map[a:1 b:2 c:3]
}
func ExampleJoinFunc() {
result := JoinFunc([]string{"a", "b", "c"}, ", ", func(s string) string {
return strings.ToUpper(s)
})
fmt.Println(result)
// Output:
// A, B, C
}