我正在阅读用户输入。我想知道如何应用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.