About 346,000 results
Open links in new tab
  1. Searching For Characters and Substring in a String in Java

    Dec 2, 2024 · In this article, we will explore essential methods like indexOf (), contains (), and startsWith () to search characters and substrings within strings in Java. 1. Using indexOf(char …

  2. java - How to search a string in another string? - Stack Overflow

    Feb 14, 2012 · How would I search for a string in another string? This is an example of what I'm talking about: If the string "word" is in the string "text", the method "findInString (String, String)" …

  3. String Searching Methods in Java

    Java provides several methods to search within strings, each suited for different needs. The contains() method checks for the presence of a substring, while indexOf() and lastIndexOf() …

  4. String (Java Platform SE 8 ) - Oracle Help Center

    The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a …

  5. java - Search for a word in a String - Stack Overflow

    May 1, 2014 · If you are looking up one string inside another you should be using indexOf or contains method. Example: See if "foo" is present in a string. But if you are looking for a …

  6. string - Substring search in Java - Stack Overflow

    For an exact String comparison, you can simply do: boolean match = stringA.equals(stringB); If you want to check that a string contains a substring, you can do: boolean contains = …

  7. Java String Search Examples - Online Tutorials Library

    Explore various examples of string search methods in Java. Learn how to efficiently find substrings, indexes, and patterns with practical code snippets.

  8. Searching Characters in a String in Java - Online Tutorials Library

    Learn how to search for characters in a string using Java. Explore methods like indexOf, lastIndexOf, and more with practical examples.

  9. Java String search

    The String class has two methods to search a string for a specified character or substring: indexOf() Searches for the first occurrence of a character or substring.

  10. Navigating the String Universe: Search and Replace in Java

    The lesson covers fundamental Java String methods that enable searching and replacing specific characters and substrings within strings. Students learn how to use 'indexOf' and 'lastIndexOf' …

Refresh