1You have to use the String method .toLowerCase() or .toUpperCase() on both the input and the string you are trying to match it with.
2
3Example:
4
5public static void findPatient() {
6 System.out.print("Enter part of the patient name: ");
7 String name = sc.nextLine();
8
9 System.out.print(myPatientList.showPatients(name));
10}
11
12//the other class
13ArrayList<String> patientList;
14
15public void showPatients(String name) {
16 boolean match = false;
17
18 for(String matchingname : patientList) {
19 if (matchingname.toLowerCase().contains(name.toLowerCase())) {
20 match = true;
21 }
22 }
23}