title: Finding whether environment variable is defined or not in C#
body: <p>Here is my code to check whether environment variable is defined or not</p>
  
  <pre><code>namespace ConsoleApplication6
  {
      class Program
      {
          static void Main(string[] args)
          {
              if(Environment.GetEnvironmentVariable("qwert")==null)
              Console.WriteLine(Environment.GetEnvironmentVariable("qwert"));
          Console.WriteLine("hello");
          }
      }
  }
  </code></pre>
  
  <p>But the problem is if I set my environment variable value as null it is executing the if statement. What is the workaround for this? The code should work for both the conditions any variable value is set or it is set as null. </p>
  
  <p><img src="https://i.stack.imgur.com/twTto.png" alt="enter image description here"></p>