2
Reply

C# Understanding This IF Statement Logic

Luke Rayner

Luke Rayner

Jan 27 2016 4:58 AM
312
Hi I have just used some code off a website for one of my classes in my C# project, I dont really understand all of the logic behind it as i am new to coding with C#. I was wondering if someone was able to write this code in pseudo and also explain the logic behind it.
 
string fullName = LastName;
if (!string.IsNullOrWhiteSpace(FirstName))
{
   if (!string.IsNullOrWhiteSpace(fullName))
   {
      fullName += ", ";
   }
   fullName += FirstName;
}
return fullName;
 
Thank you 
 

Answers (2)