indexof

package module
v0.0.0-...-b64c6b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 1 Imported by: 1

README

SYOPSIS

The IndexOf() method returns the first index at which a given element can be found in the slice, or -1 if it is not present. The only requirement of this function is that the second argument must be a slice.

INSTALL

go get github.com/hij1nx/go-indexof

USAGE

import "github.com/hij1nx/go-indexof"

var v = "bazz"
var a = []string{"bar", "foo", "bazz"}

var i = IndexOf(v, a) // "i" is assigned "2"

var v = 20
var a = []int{10, 20, 30}

var i = IndexOf(v, a) // "i" is assigned "1"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexOf

func IndexOf(params ...interface{}) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL