I need to creat a method something like... when the user inputs
test1
test2 haha
test3
end
and display that should contain exact same one as above except "end":
test1
test2 haha
test3
so the "end" is the keyword to finish the inputing...
String s = new String("");
String s1 = new String("");
System.out.println("enter String : ");
Scanner keyboard = new Scanner(System.in);
while(!s.equals("end")){
s = keyboard.nextLine();
s1 += s + "\n";
}
System.out.println("you've typed: \n");
System.out.println(s1);
oh I've just figured out. however, i see see the "end". how do i remove it?