I'm trying to do something very simple but it's not working.

Inside the "Order Shipped" email, we reference $trackingNumber.TrackingNumberData, which is the tracking number for the order. I want to put in some conditional code to check if the string is blank. In all of the below cases, the condition evaluates to false whether the tracking number is blank or set. In other words, the email is printing out:
bp2
bp4
bp6
Regardless of the value of the tracking number. Any thoughts?
#if($trackingNumber.TrackingNumberData.length() > 0)
<b>bp1</b><br>
#else
<b>bp2</b><br>
#end
#if($trackingNumber.TrackingNumberData.Length > 0)
<b>bp3</b><br>
#else
<b>bp4</b><br>
#end
#if($trackingNumber.TrackingNumberData == "")
<b>bp5</b><br>
#else
<b>bp6</b><br>
#end