0

i used this code and its not replacing idk why !

String a ="|-->"; 
String b = "<--|";
Scanner input = new Scanner(System.in);
    String search =input.nextLine(); 
    while (search.startsWith(a) & search.endsWith(b))
             search.replaceAll(a, " ").replaceAll(b, " ");
                       System.out.println(search);

//correct me if im wrong <3

EDIT : I Manged to Fix it by using replace not replace all , Thanks <3

Amod
  • 75
  • 7

0 Answers0