Skip to content

Instantly share code, notes, and snippets.

@alexejVasko
Created February 15, 2016 13:52
Show Gist options
  • Save alexejVasko/fb9ab7302e11a16cbd7f to your computer and use it in GitHub Desktop.
Save alexejVasko/fb9ab7302e11a16cbd7f to your computer and use it in GitHub Desktop.
public class StrokaPodstanovka {
public static void main(String[] args) {
String s = "Education is the most powerful weapon which you can use to change the world.";
String t = "An investment in knowledge pays the best interest.";
int use = s.indexOf("use");
int knowledge = t.indexOf("knowledge");
int to = s.indexOf("to");
System.out.print(s.substring(use, use+4));
System.out.print(t.substring(knowledge, knowledge+10));
System.out.print(s.substring(to, s.length()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment