return undef unless defined $str;