Skip to content

Instantly share code, notes, and snippets.

@mickle00
Created October 10, 2014 20:03
Show Gist options
  • Save mickle00/5989a91da0b0632e4907 to your computer and use it in GitHub Desktop.
Save mickle00/5989a91da0b0632e4907 to your computer and use it in GitHub Desktop.
string null1 = null;
string null2 = null;
string empty1 = '';
string empty2 = '';
system.debug(null1 + null2); //nullnull
system.debug(String.isNotEmpty(null1 + null2)); //true
system.debug(null1 + empty1); //null
system.debug(String.isNotEmpty(null1 + empty1)); //true
system.debug(empty1 + null1); //null
system.debug(String.isNotEmpty(empty1 + null1)); //true
system.debug(empty1 + empty2); // ''
system.debug(String.isNotEmpty(empty1 + empty2)); //false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment