I have a string that is loaded from a collection that is inturn loaded from a fixed length file. Sometimes the string is null, and when I use an IF statement to test this condition I get unexpected results. In the file, the string exists as a field of 15 spaces, sometimes blank sometimes not. When loading into my collection I use the trim() function to remove the spaces (or atleast I thought).

Here's the weird part, when I reference (display the value) of the string it will show a null value "". But if I use the Len() function, it returns a 15. and blows right through my IF statement when testing for null. I've even tried assigning it out to another var, and it tests the same way.

                If Trim(WlNum) = "" Then
                    WlNum = "(None)"
                    WlNum = item.WellNum
                End If
Even when WlNum is = "" it blows right through to ELSE.