This is my code.
String x = \"1+√10\"; x = x.replace(\".*\", \"x\"); System.out.println(x);
This should return \"x\" but
\"x\"
String#replace doesn't support regex, use String#replaceAll:
String#replace
String#replaceAll
x = x.replaceAll(".+", "x");