Advertisement
RGAlex

O3. Substring / Text Processing - Lab

Mar 11th, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. package TextPlocessing.Lab;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class O3Substring {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         String input = scanner.nextLine(), text = scanner.nextLine();
  9.         while (text.contains(input)) {
  10.             text = text.replaceAll(input, "");
  11.         }
  12.         System.out.println(text);
  13.     }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement