I'm playing with string manipulation and I would like to do something like this, when a user types the lesson name: Windows Server, the program should remove Windows plus white space character and display only Server. I managed to do this using this code:
Scanner in = new Scanner(System.in);
String lesson;
System.out.println("Input lesson name: ");
lesson = in.nextLine();
String newLesson = lesson.replaceAll("Windows\\s+", "");
System.out.println("New Lesson is " + newLesson);
But now I want to remove multiple characters like Linux and Unix. How would I include in my regex Linux and Unix?
If the user would type in Linux Administration, the program should display Administration only.