mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
Slice: Add GroupBy func (#10)
Group by: split slice into two groups, applies on each slice element a predicate func to categorize this element. Changes * Add groub by func * Add test case for this func
This commit is contained in:
@@ -413,6 +413,7 @@ func Unique(slice interface{}) interface{} //去重切片
|
||||
func Union(slices ...interface{}) interface{} //slice并集, 去重
|
||||
func UpdateByIndex(slice interface{}, index int, value interface{}) (interface{}, error) //在切片中index位置更新value
|
||||
func Without(slice interface{}, values ...interface{}) interface{} //slice去除values
|
||||
func GroupBy(slice, function interface{}) (interface{}, interface{})
|
||||
```
|
||||
|
||||
#### 10. strutil字符串处理包
|
||||
|
||||
Reference in New Issue
Block a user