๐ŸŒ
Oracle
docs.oracle.com โ€บ javase โ€บ 8 โ€บ docs โ€บ api โ€บ java โ€บ lang โ€บ String.html
String (Java Platform SE 8 )
July 21, 2026 - 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 string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ ref_string_substring.asp
Java String substring() Method
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The substring() method returns a substring from the string.
Discussions

What does String.substring exactly do in Java? - Stack Overflow
I always thought if I do String s = "Hello World".substring(0, 5), then I just get a new string s = "Hello". This is also documented in the Java API doc: "Returns a new string that is a substring o... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to correctly use the substring method? (Java)
You are deeply confused about how substring() works - it's a method of String, and it does not take Strings as parameters. See here for an example. More on reddit.com
๐ŸŒ r/learnprogramming
5
5
February 2, 2013
string - Substring search in Java - Stack Overflow
I have a problem with string comparison. For example, there is this string: "hello world i am from heaven" I want to search if this string contains "world". I used following functions but they hav... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Java: Getting a substring from a string starting after a particular character - Stack Overflow
I have a string: /abc/def/ghfj.doc I would like to extract ghfj.doc from this, i.e. the substring after the last /, or first / from right. Could someone please provide some help? More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ substring-in-java
Java String substring() Method - GeeksforGeeks
April 11, 2025 - Explanation: In the above code example, we use the substring(int beginIndex) method and specify the start index which is 8 and it didn't specified the end index. So it will make substring from end of the given string and we get the substring as "Geeks". ... Example 2: Java program to extract a substring from specified start index to specified end index using substring(int beginIndex, int endIndex).
๐ŸŒ
CodeGym
codegym.cc โ€บ java blog โ€บ strings in java โ€บ substring in java
Java String substring()
Java Substring in general is a contiguous sequence of characters inside the String. It could be a part of the String or the whole String as well. What is substring in Java? This language has a substring() method, or rather two methods, thanks ...
Published: July 23, 2024
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ java โ€บ strings โ€บ .substring()
Java | Strings | .substring() | Codecademy
April 28, 2025 - The .substring() method in Java returns a portion of a string from a specified starting index to an (optional) ending index.
๐ŸŒ
HappyCoders
happycoders.eu โ€บ home โ€บ java โ€บ java substring() method
Java substring() Method
June 12, 2025 - The string constructor used in the first line checks whether the string passed is a substring. If so, it creates a copy of the requested section. The string concatenation used in the second line only leads to the desired result as of Java 5 (see below).
๐ŸŒ
YouTube
youtube.com โ€บ watch
Java substrings are easy! ๐Ÿ“ง - YouTube
#java #javatutorial #javacourse This is a beginner's introduction to substrings and we'll use it to code an email slicer that extracts a username and domain ...
Published: December 5, 2024
Find elsewhere
๐ŸŒ
IONOS
ionos.com โ€บ digital guide โ€บ websites โ€บ web development โ€บ java substrings
How to use the Java substring method - IONOS
January 6, 2025 - If you want to extract a specific subset from the larger string, you have several options. The method Java String.split() breaks an entire string down into its inยญdiยญvidยญual parts to, for example, give you a clearer overview of the string. The method substring() takes that one step further and returns only the part of the string that you define.
๐ŸŒ
DevGenius
blog.devgenius.io โ€บ java-substring-a-comprehensive-guide-082192995d1e
Java Substring Failed When Input Changed Shape | Dev Genius
July 6, 2026 - A substring is a sequence of characters derived from another string. For example, in the string "Hello, World!", the substrings "Hello", "World", and "lo, Wo" are all valid substrings.
๐ŸŒ
Medium
maheshjtp.medium.com โ€บ what-is-a-substring-in-java-syntax-applications-of-java-substring-9abbf79350e9
What is a Substring in Java? Syntax/ Applications of Java Substring | by Mahesh Sharma | Medium
March 7, 2025 - In the realm of Java programming, the substring functionality stands as a powerful tool for manipulating and extracting portions of text data within strings.
๐ŸŒ
Quora
quora.com โ€บ How-do-you-use-substring-and-lastIndexOf-in-Java
How to use substring and lastIndexOf in Java - Quora
Answer: The substring() method extracts characters, between two indices (positions), from a string, and returns the substring. The substring() method extracts characters from start to end (exclusive). The substring() method does not change the original string. The lastIndexOf() method returns th...
๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ how to correctly use the substring method? (java)
r/learnprogramming on Reddit: How to correctly use the substring method? (Java)
February 2, 2013 -

Hey guys, I've been working on this Java homework for my class and this whole section about string manipulation is confusing me.

The homework asks to add statements that use the substring method to get the first half and second half of phrase.

I'm assuming that means using the substring method, but I always get errors trying to compile what I put in. So here's the code. I'm not exactly sure how to use the substring method in the way they ask, and my book doesn't really go over it well. Should I be creating another variable or just use what I have?

๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java string โ€บ get substring from string in java
Get Substring from String in Java | Baeldung
July 21, 2024 - For more details on the Java regular expressions check out this tutorial. We can use the split method from the String class to extract a substring. Say we want to extract the first sentence from the example String.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ dotnet โ€บ api โ€บ java.lang.string.substring
String.Substring Method (Java.Lang) | Microsoft Learn
Returns a string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ java-string-substring
Master Java Substring Method: Examples, Syntax, and Use Cases | DigitalOcean
Learn how to use the Java substring method. Explore syntax, practical examples, and common errors to handle substrings effectively.
๐ŸŒ
Igmguru
igmguru.com โ€บ home โ€บ blog โ€บ java โ€บ substring in java
Java String substring() Method: A Complete Guide | igmGuru
3 weeks ago - Learn what is substring and how this contiguous sequence of characters within a string (Java Class) is used to extract specific portions of text with this Java tutorial.
๐ŸŒ
FavTutor
favtutor.com โ€บ blogs โ€บ java-substrings
Substring in Java (with examples)
November 5, 2023 - In Java, the substring is a powerful method that allows developers to extract subsets or parts of a string. By using the substring() method, you can create smaller strings from a bigger one without modifying the original string.