title: c# multiple if conditions in same lane
body: <p>I have a slight problem when working with c# and using IF statments with multiple conditions.</p>
  
  <p>This is the most common occurance.</p>
  
  <pre><code>private void SomeFunction(string SomeString)
  {
  
     if(SomeString != null &amp;&amp; SomeString.Trim() != "")
     {
     }
  }
  </code></pre>
  
  <p>In some languages like javascript if the first argument fails (SomeString != null) the second check wont be made. C# seems to check both arguments even if the first one fails and then the second one will throw an exception since you cannot use .Trim() on a null value.</p>
  
  <p>Right now I am going over this by nesting my ifs which is messy work. Like this:</p>
  
  <pre><code>private void SomeFunction(string SomeString)
  {
  
     if(SomeString != null)
     {
       if(SomeString.Trim() != "")
       {
        .....
       }
     }
  }
  </code></pre>
  
  <p>Does anybody have any suggestions or best practices on a better way to solve this?</p>