我正在閱讀用戶輸入。我想知道如何將equalsIgnoreCase
應用於用戶輸入?用戶輸入忽略大小寫
ArrayList<String> aListColors = new ArrayList<String>();
aListColors.add("Red");
aListColors.add("Green");
aListColors.add("Blue");
InputStreamReader istream = new InputStreamReader(System.in) ;
BufferedReader bufRead = new BufferedReader(istream) ;
String rem = bufRead.readLine(); // the user can enter 'red' instead of 'Red'
aListColors.remove(rem); //equalsIgnoreCase or other procedure to match and remove.
equalsIgnoreCase是什麼? (另外,添加java標籤) – MByD 2011-03-27 09:42:38