About 1,910,000 results
Open links in new tab
  1. How to find the index of an element in an array in Java?

    Nov 9, 2011 · Starting with Java 8, the general purpose solution for a primitive array arr, and a value to search val, is: return IntStream.range(0, arr.length).filter(i -> arr[i] == …

  2. Java String indexOf() Method - W3Schools

    The indexOf() method returns the position of the first occurrence of specified character(s) in a string. Tip: Use the lastIndexOf method to return the position of the last occurrence of …

  3. Find the Index of an Array Element in Java - GeeksforGeeks

    Dec 9, 2024 · One of the simplest and most straightforward ways to find the index of an element in an array is by using a loop. You can iterate through the array and compare each element …

  4. Find the Index of an Element in a Java Array | Baeldung

    Dec 7, 2023 · In this tutorial, we’ll discuss various methods, with code examples, for finding the index of an array element using both Java’s built-in APIs and a third-party library. This can be …

  5. How to Retrieve the Index of a String in an Array in Java?

    Learn how to find the index of a specific string in a Java array with native methods and examples.

  6. How to find index of STRING array in Java from a given value?

    This uses the Arrays class to convert the TYPES array to a List<String> object. The List class has a method(.indexOf) which will return the index of the passed in object (in this case a String). …

  7. Java: Find Index of Element in Array - Java Guides

    This guide will cover different ways to find the index of an element in an array, including using loops, the Arrays utility class, and the ArrayList class. Java provides several ways to search …

  8. indexOf Method in Java (with Examples) - FavTutor

    Nov 18, 2023 · What is the indexOf Method in Java? The indexOf () method is a member of the String class in Java and is used to find the position of the first occurrence of a specified …

  9. String Arrays in Java - GeeksforGeeks

    Nov 25, 2024 · In this article, we will learn the concepts of String Arrays in Java including declaration, initialization, iteration, searching, sorting, and converting a String Array to a single …

  10. String Array in Java - BeginnersBook

    Oct 25, 2022 · String array is a collection of strings, stored in contiguous memory locations. For example: The following string array contains four elements. These elements are stored in …

  11. Some results have been removed
Refresh