Top "Indexof" questions

indexof is a method in programming languages like Java, C#, JavaScript, etc.

How to find the array index with a value?

Say I've got this imageList = [100,200,300,400,500]; Which gives me [0]100 [1]200 etc. Is there any way in JavaScript to return the index with …

javascript arrays indexof
How to trim a file extension from a String in JavaScript?

For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let's …

javascript replace substring substr indexof
Where is Java's Array indexOf?

I must be missing something very obvious, but I've searched all over and can't find this method.

java arrays indexof
Index of element in NumPy array

In Python we can get the index of a value in an array by using .index(). But with a NumPy …

python arrays numpy indexing indexof
Get value of a string after last slash in JavaScript

I am already trying for over an hour and cant figure out the right way to do it, although it …

javascript substring indexof slash
How to get the index of an element in an IEnumerable?

I wrote this: public static class EnumerableExtensions { public static int IndexOf<T>(this IEnumerable<T> obj, …

c# .net linq ienumerable indexof
In an array of objects, fastest way to find the index of an object whose attributes match a search

I've been surfing around a little trying to find an efficient way to do this, but have gotten nowhere. I …

javascript arrays indexof
Is there a version of JavaScript's String.indexOf() that allows for regular expressions?

In javascript, is there an equivalent of String.indexOf() that takes a regular expression instead of a string for the …

javascript regex indexof
Getting Index of an item in an arraylist;

I have a Class called AuctionItem. The AuctionItem Class has a method called getName() that returns a String. If I …

java arraylist find element indexof
How to find indices of all occurrences of one string in another in JavaScript?

I'm trying to find the positions of all occurrences of a string in another string, case-insensitive. For example, given the …

javascript regex string indexof