About 619,000 results
Open links in new tab
  1. How to extract specific parts of a string JAVA - Stack Overflow

    Feb 18, 2017 · To get this sub-string we need to supply the String.substring() method with two specific arguments, the Start Index of where the sub-string starts within the string and the End …

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

  3. Get Substring from String in Java - Baeldung

    Jul 21, 2024 · So far, we’ve explored various ways to extract the required substring from an input string. Sometimes, our input contains a specific substring, but instead of extracting that …

  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. java - How to extract a substring using regex - Stack Overflow

    How can I write a regex to extract "the data i want" from the following text? Assuming you want the part between single quotes, use this regular expression with a Matcher: "'(.*?)'" Example: …

  6. Java: Getting a substring from a string starting after a particular ...

    In Kotlin you can use substringAfterLast, specifying a delimiter. From the doc: Returns a substring after the last occurrence of delimiter. If the string does not contain the delimiter, returns …

  7. How to Extract a Java Substring [with Code Examples] - Hackr

    Jan 30, 2025 · The Java String class provides the .substring() method that you can use to extract a substring from an original string. Alternatively, you can use the built-in .split () method to split …

  8. Java String.substring() - Baeldung

    Apr 11, 2025 · String sub = s.substring(0, 20); A quick example and explanation of the substring () API of the standard String class in Java.

  9. Java Substring: A Comprehensive Guide - Dev Genius

    Mar 11, 2025 · The substring method in Java is a powerful tool for string manipulation, allowing efficient extraction of portions of a string. Developers can use it effectively in real-world …

  10. Master Java Substring Method: Examples, Syntax, and Use Cases

    Feb 20, 2025 · In this tutorial, we’ll cover its syntax, use cases, and potential pitfalls while providing practical examples and solutions to common errors. Parameters: beginIndex - the …

Refresh