# README
Slices Examples
Remove duplicates
- From a []string
package main
import (
"fmt"
"github.com/D3Ext/maldev/src/slices"
)
func main(){
unique := slices.RemoveDuplicatesStr([]string{"first", "second", "third", "first", "third"})
fmt.Println(unique)
}
- From a []int
package main
import (
"fmt"
"github.com/D3Ext/maldev/src/slices"
)
func main(){
unique := slices.RemoveDuplicatesInt([]int{1, 2, 3, 1, 3})
fmt.Println(unique)
}
Check if slice contains
- Strings
package main
import (
"fmt"
"github.com/D3Ext/maldev/src/slices"
)
func main(){
check := slices.StringSliceContains([]string{"first", "second", "third", "first", "third"}, "second")
fmt.Println(check)
}
- Ints
package main
import (
"fmt"
"github.com/D3Ext/maldev/src/slices"
)
func main(){
check := slices.IntSliceContains([]int{1, 2, 3, 1, 3}, 2)
fmt.Println(check)
}
- Strings (insensitive)
package main
import (
"fmt"
"github.com/D3Ext/maldev/src/slices"
)
func main(){
check := slices.StringSliceContainsInsensitive([]string{"fiRSt", "seCoNd", "tHirD", "FirSt", "ThiRd"}, "second")
fmt.Println(check)
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author