/* * Main.java * * Created on January 10, 2011, 3:44 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package substrword; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * @author ocamposm */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { // TODO code application logic here //String str = "Yellow Fever"; String str = ""; System.out.println("Enter word/s:"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); str = br.readLine(); for (int i=0; i<=str.length(); i++) System.out.println(str.substring(0,i)); } }