您可以尝试这样的事情:
String variable = ""; #write a string name StringBuffer rev = new StringBuffer(variable).reverse(); String strRev = rev.toString(); if(variable.equalsIgnoreCase(strRev)) # Check the condition

您可以尝试这样的事情:
String variable = ""; #write a string name StringBuffer rev = new StringBuffer(variable).reverse(); String strRev = rev.toString(); if(variable.equalsIgnoreCase(strRev)) # Check the condition