如何在不使用 ToUpper/ToLower 的情况下将大写字符与小写字符匹配,这可能吗?
例子:
String content = "are";
String keyword = "ARE";
if(content==keyword ){
System.out.println("Working!");
}else{
System.out.println("Not Working!");
}
上面的代码将打印Not Working!
.
示例 2:
String content = "how are you?";
String keyword = "ARE";
if(content.matches("(.*)(\\b)"+keyword+"(\\b)(.*)"))){
System.out.println("Working!");
}else{
System.out.println("Not Working!");
}