+ 2
Whats wrong with my code ?!
import java.util.Scanner; public class Program{ public static void main(String [] args){ Scanner sc = new Scanner(System.in); String str = sc.nextLine(); str = str.replace('x', '\u0000'); if(str.contains("$T")==true || str.contains("T
quot;)==true){ System.out.println("ALARM"); } else{ System.out.println("quiet"); } sc.close(); } } The question is from CodeCoach Security problem1 Answer
+ 1
Congratulations, nice idea đ
Try it this way:
str = str.replace("x", "");
This \u0000 will only not be printed, but is still there and will be considered as contained in the string.