I am giving the code and I am not getting true even I use the correct regular expression. Please correct me and explain me clearly as I might not looking at the actual problem in overlook.
I should be getting true and I am getting false. I tried cleaning the project but there is no use
I should be getting true and I am getting false. I tried cleaning the project but there is no use
code:
public class Sstring {
public static void main (String args[]) {
String str="K";
System.out.println(str.matches("\W"));
}
}
enter image description here