Advertisement
deyanmalinov

02. Substring

Mar 21st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. package DPM;
  2.  
  3. import java.util.*;
  4.  
  5. public class Main {
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.         String sub = scan.nextLine();
  9.         String line = scan.nextLine();
  10.  
  11.         while (line.contains(sub)){
  12.              line= line.replace(sub, "");
  13.         }
  14.         System.out.println(line);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement