Top "Indexof" questions

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

Finding second occurrence of a substring in a string in Java

We are given a string, say, "itiswhatitis" and a substring, say, "is". I need to find the index of 'i' …

java string substring indexof
Uncaught TypeError: .indexOf is not a function

I am new to JavaScript and I'm getting an error as below. Uncaught TypeError: time.indexOf is not a function …

javascript function indexof
Why doesn't indexOf work on an array IE8?

The below function works fine on Opera, Firefox and Chrome. However, in IE8 it fails on the if ( allowed.indexOf(…

javascript internet-explorer internet-explorer-8 indexof
How can I get a character in a string by index?

I know that I can return the index of a particular character of a string with the indexof() function, but …

c# .net string indexof
indexOf and lastIndexOf in PHP?

In Java, we can use indexOf and lastIndexOf. Since those functions don't exist in PHP, what would be the PHP …

php indexof lastindexof
How to use IndexOf() method of List<object>

All the examples I see of using the IndexOf() method in List<T> are of basic string types. …

c# list indexof
How to use IndexOf in JQuery

if($('#this').val().indexOf('4289')){ Do something else Do something. This works only with that 4289, When I try …

javascript jquery html blur indexof
How to get the Index of second comma in a string

I have a string in an Array that contains two commas as well as tabs and white spaces. I'm trying …

c# .net string indexof
Get the index of the nth occurrence of a string?

Unless I am missing an obvious built-in method, what is the quickest way to get the nth occurrence of a …

c# .net string indexing indexof
How do I check if a char is a vowel?

This Java code is giving me trouble: String word = <Uses an input> int y = 3; char z; do { z = …

java string char indexof truncation