About 223,000 results
Open links in new tab
  1. Pattern/Matcher group() to obtain substring in Java?

    I'd like to match a pattern in a Java string and then extract the portion matched using a regex (like Perl's $& operator). This is my source string "s": …

  2. Get Substring from String in Java - Baeldung

    Jul 21, 2024 · In this quick article, we found out various ways to extract a substring from a String in Java. We also offer other tutorials for String manipulations in Java.

  3. 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 …

  4. Java String substring() Method - W3Schools

    The substring() method returns a substring from the string. If the end argument is not specified then the substring will end at the end of the string.

  5. How to extract a substring using regex - W3docs

    To extract a substring from a string using a regular expression in Java, you can use the following steps: Compile the regular expression pattern using the compile() method of the Pattern class: …

  6. How to extract a substring from a given string pattern in Java

    To extract a substring from a given string pattern in Java using regular expressions, you can use the java.util.regex package, which provides the Pattern and Matcher classes for working with …

  7. Java: Find Substring in String - Java Guides

    Finding a substring within a string is a common task in Java. This guide will cover different ways to find a substring, including using the indexOf method, the contains method, and regular …

  8. java - How to extract a substring using regex - Stack Overflow

    Searches a String for substrings delimited by a start and end tag, returning all matching substrings in an array. For the example in question to get all instances of the matching substring. String[] …

  9. Find Substring Matching In Java 2025 - SoftwareTestingo

    Aug 9, 2024 · Find Substring Matching In Java: If you want to check if a String contains a certain sub-string, there are several ways to do it in Java. Most of them are similar to what you’d find …

  10. Java String substring() Method - GeeksforGeeks

    Apr 11, 2025 · In Java, the substring() method of the String class returns a substring from the given string. This method is most useful when you deal with text manipulation, parsing, or data …