We’re almost done talking about not equals! This one should be a breeze because of what you’ve learned so far.
We can use the !=
operator with Strings to compare String values while ignoring casing.
String a = 'CampApex'; String b = 'CampApex'; Boolean isSame = a != b; // isSame becomes False, because they are the same String c = 'campapex'; isSame = a != c; // isSame remains False, because != is case insensitive String d = 'Camp Apex'; isSame = a != d; // isSame changes to True because of the spacing isSame = d != 'Camp Apex'; // isSame changes back to False
LET's GO!!! You're almost done with this course. Get ready to tackle the last challenge!