import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str1=scan.nextLine(); String str2=scan.nextLine(); char c=str2.charAt(0); for(int i=0;i<str1.legnth();i++) { if(str1.charAt(i)!=c) System.out.print(str1.charAt(i)); } } } /* Main.java:9: error: cannot find symbol for(int i=0;i<str1.legnth();i++) ^ symbol: method legnth() location: variable str1 of type String 1 error */ |
Double click to view unformatted code.