Created
October 15, 2019 07:04
-
-
Save gauravkukade/904f63dba09cecc4fa9bb39f2b6a359a to your computer and use it in GitHub Desktop.
A Java program to explain the substring method, which accepts both parameter 'beginIndex' and 'endIndex'. This example is used in a blog a https://coderolls.com/java-substring-method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Java program to explain the substring method, | |
* which accepts both parameter 'beginIndex' and 'endIndex'. | |
* | |
* | |
* @author Gaurav Kukade at coderolls.com | |
* | |
*/ | |
public class SubstringExampleWithBothIndex { | |
public static void main(String[] args) { | |
String name = "codeRolls.com"; | |
String result = name.substring(4, 9); | |
System.out.println(result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment