Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package example19;
- /*
- * @author Froge
- */
- import java.util.Scanner;
- import java.lang.String;
- public class Example19 {
- public static void main(String [] args) {
- String sentence, wordTakenOut, newSentence;
- Scanner input = new Scanner(System.in);
- System.out.print("Enter a sentence: ");
- sentence = input.nextLine();
- System.out.print("Enter a string: ");
- wordTakenOut = input.nextLine();
- input.close();
- newSentence = sentence.replace(wordTakenOut + " ","");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement