Skip to content

Instantly share code, notes, and snippets.

@Yur-ok
Created December 5, 2015 14:21
Show Gist options
  • Save Yur-ok/4d859a574a3f37ed9576 to your computer and use it in GitHub Desktop.
Save Yur-ok/4d859a574a3f37ed9576 to your computer and use it in GitHub Desktop.
Substring "again" without counting characters
package Lesson1_frame4;
/**
* Created by Юрий on 05.12.2015.
*/
public class Again {
public static void main(String[] args) {
String mjQuote = "I'm failed over and over and over again in my life and that is why I succeed!";
System.out.println(mjQuote.substring(mjQuote.indexOf("again"), mjQuote.indexOf(" in")));
}
}
@Yur-ok
Copy link
Author

Yur-ok commented Dec 5, 2015

Единственное я так и не понял зачем давался метод length(); и как его надо было зедсь применить?

Как же так Олег!
В ответном видео ты посчитал символы, а в задании сказано (- символы не считать)!!!
Такая постановка задачи ставит в тупик.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment