Skip to content

Instantly share code, notes, and snippets.

@gauravkukade
Last active October 15, 2019 12:21
Show Gist options
  • Save gauravkukade/728a781f09d0346e8c7d835a58b32f49 to your computer and use it in GitHub Desktop.
Save gauravkukade/728a781f09d0346e8c7d835a58b32f49 to your computer and use it in GitHub Desktop.
A Java program to explain the substring() method. This example is used in a blog at https://coderolls.com/java-substring-method
/**
* A Java program to explain the substring() method.
*
* @author Gaurav Kukade at coderolls.com
*
*/
public class SubstringExample {
public static void main(String[] args) {
String name = "coderolls.com";
String result = name.substring(4);
System.out.println(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment