Skip to content

Instantly share code, notes, and snippets.

@hu2di
Created April 10, 2017 02:29
Show Gist options
  • Save hu2di/eef0dae09f6955638ad1c15540c37d29 to your computer and use it in GitHub Desktop.
Save hu2di/eef0dae09f6955638ad1c15540c37d29 to your computer and use it in GitHub Desktop.
Java: SubString
public class MySubString {
public static void main(String args[]) {
String s1="HuyHung";
System.out.println(s1.substring(2,4));//return yH
System.out.println(s1.substring(2)); //return yHung
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment