Skip to Content
0
Former Member
Apr 20, 2010 at 11:48 AM

best way to check if string is null

1968 Views

Hello experts,

which is the correct way to check if a string is null ?

one of the following works in different situations while others dont work

is there any specific thing to keep in mind to use a particular method to check if the string is null ?

if(c3.getContents()==null)

if(c3.getContents().equals(""))

if(c3.getContents().length()==0)

thanks

B