108
I'm not sure what was wrong with The MYYN's answer.
if (yourString != null) {
//do fun stuff with yourString here
}
The above null check is quite alright.
If you are trying to check if a String reference is equal (ignoring case) to another string that you know is not a null reference, then do something like this:
String x = "this is not a null reference"
if (x.equalsIgnoreCase(yourStringReferenceThatMightBeNull) ) {
//do fun stuff
}
If there is any doubt as to whether or not you have null references for both Strings you are comparing, you'll need to check for a null reference on at least one of them to avoid the possibility of a NullPointerException.