title: Ignore a null statement, apply method only to strings that are populated
body: <p>How do you ignore a null statement, and only apply a method to remove special characters to only strings that are populated.</p>
  
  <pre><code>Answer1 = RemoveSpecialChars(doc.SelectSingleNode("/Main/Answer[@answerid='1']").Attributes["keypress"].Value);                 
  Answer2 = RemoveSpecialChars(doc.SelectSingleNode("/Main/Answer[@answerid='2']").Attributes["keypress"].Value);
  
   public string RemoveSpecialChars(string input)
         {
  
             return Regex.Replace(input, @"[^0-9a-zA-Z\._]", string.Empty);
         }
  </code></pre>
  
  <p>What's happening, is when the user presses and sends an answer one, and nothing for answer two I get an exception, because the method is trying to run on an empty string.  What is the best way to pass answer1, if answer 2 is empty?</p>