Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Stroki_Sumvoly;
- public class Succeed {
- public static void main(String[] args) {
- String mjQuote="I've failed over and over again in my life and that is why I succeed!";
- //Variant1
- System.out.println(mjQuote.substring(mjQuote.length()-8, mjQuote.length()-1));
- //Variant2
- System.out.println(mjQuote.substring(mjQuote.length()-"succeed".length()-1, mjQuote.length()-1));
- String quote="I succeed!";
- System.out.println(quote.substring(quote.length()-"succeed".length()-1, quote.length()-1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement