1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-13 17:22:27 +08:00

Slice: Add count func (#15)

Returns the count of matched elements
This commit is contained in:
donutloop
2022-01-06 13:32:14 +01:00
committed by GitHub
parent c7e961704d
commit 3905c0bde1
4 changed files with 37 additions and 0 deletions

View File

@@ -420,6 +420,7 @@ func Union(slices ...interface{}) interface{} //Union creates a slice of unique
func UpdateByIndex(slice interface{}, index int, value interface{}) (interface{}, error) //update the slice element at index.
func Without(slice interface{}, values ...interface{}) interface{} //creates a slice excluding all given values
func GroupBy(slice, function interface{}) (interface{}, interface{}) // groups slice into two categories
func Count(slice, function interface{}) int // Count iterates over elements of slice, returns a count of all matched elements
```
#### 10. strutil is for processing string