1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

feat: add JoinFunc

This commit is contained in:
dudaodong
2024-10-24 14:56:13 +08:00
parent 921f218ef7
commit 2015d36b08
5 changed files with 126 additions and 0 deletions

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
}