Skip to content

Instantly share code, notes, and snippets.

@Yur-ok
Created December 5, 2015 19:20
Show Gist options
  • Save Yur-ok/3abfc3bca06615547e77 to your computer and use it in GitHub Desktop.
Save Yur-ok/3abfc3bca06615547e77 to your computer and use it in GitHub Desktop.
Use knowledge to change the world
package Lesson1_frame5;
/**
* Created by Юрий on 06.12.2015.
*/
public class StringConcatination {
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.";
String use = s.substring(s.indexOf("use"),s.indexOf(" to"));
String know = t.substring(t.indexOf("knowle"),t.indexOf(" pay"));
String tochworld = s.substring(s.indexOf("to chang"),s.indexOf("."));
System.out.println(use + " " + know + " " + tochworld);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment