Skip to content

Instantly share code, notes, and snippets.

@ilyaBrandon
Created February 17, 2016 20:47
Show Gist options
  • Select an option

  • Save ilyaBrandon/7cf8a8eadbd4c9319392 to your computer and use it in GitHub Desktop.

Select an option

Save ilyaBrandon/7cf8a8eadbd4c9319392 to your computer and use it in GitHub Desktop.
public class Documents {
public static void main(String[] args) {
String a1 = "use ";
String b2 = "knowledge ";
String c3 = "to change the world ";
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";
String st = s + t;
System.out.print(st.substring(st.indexOf(a1), st.indexOf(a1) + a1.length()));
System.out.print(st.substring(st.indexOf(b2), st.indexOf(b2) + b2.length()));
System.out.print(st.substring(st.indexOf(c3), st.indexOf(c3) + c3.length()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment