Created
February 14, 2016 11:49
-
-
Save alexejVasko/adba3f8d387c0ac70b54 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package substring; | |
public class SubstringAgain { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
String mjQuote = "I've failed over and over and over again" + | |
" in my life and that is why I succeed!"; | |
String again = "again"; | |
System.out.println(mjQuote.substring(mjQuote.indexOf("again"), mjQuote.indexOf("again") + 5)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment