bash check if variable is empty

C++
if [ -z "$variable" ];
  then echo "$variable is null";
  else echo "$variable is not null";
fiif [ -z "$var" ] #return true if $var is unset
Source

Also in C++: