W3Schools
w3schools.com › JAVA › ref_string_substring.asp
Java String substring() Method
The substring() method returns a substring from the string.
IONOS
ionos.com › digital guide › websites › web development › java substrings
How to use the Java substring method - IONOS
January 6, 2025 - To use substring(), you’ll first enter the string that you want to extract the substring from. Then you use an integer to define where the substring should begin. You can view the output with the Java command System.out.println. The method works inclusively, meaning that the character that is in the position of the index you enter will also be separated.
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
Time complexity of String.Contains()
You need to understand how collections work... A string is an object but is also a collection of char structs. The IndexOf method returns the index in the array where the sequence of elements first match. Microsoft did something really smart here to reuse code, if a string contains an element/sequence it should also have an index, so they call the IndexOf method. If the method returns anything higher than -1 then it means that the collection does contain said sequence because it has an index. So to answer your question, look at the IndexOf method. More on reddit.com
Android Studio can't resolve my substring method.
Error message?
ss.substring(-2) - what are you trying to do here? Can't use a negative index with a substring.
What are you doing with the second wordUp.substring(length, (length - 1)); This also makes no sense.
Look in the docs at Android String
More on reddit.comHow can I split a String without using the Split method?
iterate through the String, when you reach a char that matches your split value take the string from a start position to your current position and store that in your array. Keep iterating until you reach a char that does not match your split value and set that position as your new start position.... More on reddit.com
08:05
Java substrings are easy! 📧 - YouTube
substring And length (Java String Methods) - YouTube
03:31
substring method in java | substring in Java example | String ...
05:42
Explain substring() method of String Class in Java (Core Java ...
String subString() Method Use with example
07:40
How to print a substring of a given String using Java substring() ...
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: how to use it and how it works
Java substring() Method: How to Use It and How It Works
4 weeks ago - Ultimately, the JDK developers weighed the pros and cons of the previous solution and decided to change the implementation in Java 7 Update 6: since then, char arrays are no longer shared between strings; instead, the substring() method (or the String constructor it calls) creates a copy of the requested section of the char array.
BeginnersBook
beginnersbook.com › 2013 › 12 › java-string-substring-method-example
Java String substring() Method with examples
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex – 1. Thus the length of the substring is endIndex-beginIndex. Examples: “hamburger”.substring(4, 8) returns “urge” “smiles”...
Programiz
programiz.com › java-programming › library › string › substring
Java String substring() | Programiz
January 31, 2024 - The Java substring() method extracts a part of the string (substring) and returns it.
Tutorialspoint
tutorialspoint.com › java › lang › string_substring.htm
Java - String substring() Method
The Java String substring() method is used to retrieve a substring of a String object. The substring starts with the character at the given index and continues to the end of the current string.
Simplilearn
simplilearn.com › home › resources › software development › all you should know about substring in java
All You Should Know About Substring in Java | Simplilearn
September 11, 2025 - In this example, the substring() method is called on the str string with parameters 6 and 11. This means that the new substring will start at index 6 (which is the letter 'W' in "World") and end at index 11 (which is the last letter 'd' in "World"). The resulting substring is then assigned to the substrate variable and printed to the console. Here's an example program that uses the substring() method in Java, including some exception handling and corner cases:
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
How to do in Java
howtodoinjava.com › home › string › java string substring()
Java String substring() with Examples - HowToDoInJava
January 10, 2023 - String substring(int beginIndex) String substring(int beginIndex, int endIndex) The method returns the substring between the valid start and end indices.
JavaBeat
javabeat.net › use-string-substring-method-java
How to Use String substring() Method in Java
In the following code, we use the substring() method to extract different substrings from the input string: public class ExtractSubstrings { public static void main(String[] args) { String inputString = "Welcome to JavaBeat.net"; int stringLen = inputString.length(); //Using Substring() With one Parameter System.out.println("String Characters From Index 11 Onwards: " + inputString.substring(11)); System.out.println("Extracting Domain Extension: " + inputString.substring(stringLen - 4)); //Using Substring() With two Parameters System.out.println("Extracting Domain Name: " + inputString.substring(11, stringLen)); System.out.println("Extracting a Specific Substring: " + inputString.substring(11, 15)); } }