Advertisement
Guest User

Untitled

a guest
Oct 7th, 2019
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. package com.company.ExamM;
  2. import java.util.ArrayList;
  3. import java.util.LinkedHashMap;
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class RealShit2 {
  8. public static void main(String[] args) {
  9. Scanner sc = new Scanner(System.in);
  10.  
  11. String key=sc.nextLine();
  12. String text=sc.nextLine();
  13.  
  14. int index=text.indexOf(key);
  15.  
  16. while(index!=-1){
  17. text=text.replace(key,"");
  18. index=text.indexOf(key);
  19. }
  20. System.out.print(text);
  21.  
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement