Source: http://stackoverflow.com/questions/4679746/time-complexity-of-javas-substring http://stackoverflow.com/questions/16123446/java-7-string-substring-complexity ...
System.out.println(s1.substring(2)); //from 2nd index to last System.out.println(s1.substring(0, 1)); System.out.println(s1.substring(2,4)); //from 2nd index to 4th index ...