title: C# string splitting
body: <p>If I have a string: <code>str1|str2|str3|srt4</code> and parse it with <code>|</code> as a delimiter. My output would be <code>str1 str2 str3 str4</code>.</p>
  
  <p>But if I have a string: <code>str1||str3|str4</code> output would be <code>str1 str3 str4</code>. What I'm looking for my output to be like is <code>str1 null/blank str3 str4</code>.</p>
  
  <p>I hope this makes sense. </p>
  
  <pre><code>string createText = "srt1||str3|str4";
  string[] txt = createText.Split(new[] { '|', ',' },
                     StringSplitOptions.RemoveEmptyEntries);
  if (File.Exists(path))
  {
      //Console.WriteLine("{0} already exists.", path);
      File.Delete(path);
      // write to file.
  
      using (StreamWriter sw = new StreamWriter(path, true, Encoding.Unicode))
      {
          sw.WriteLine("str1:{0}",txt[0]);
          sw.WriteLine("str2:{0}",txt[1]);
          sw.WriteLine("str3:{0}",txt[2]);
          sw.WriteLine("str4:{0}",txt[3]);
      }
  }
  </code></pre>
  
  <h3>Output</h3>
  
  <pre><code>str1:str1
  str2:str3
  str3:str4
  str4:"blank"
  </code></pre>
  
  <p>Thats not what i'm looking for. This is what I would like to code:</p>
  
  <pre><code>str1:str1
  str2:"blank"
  str3:str3
  str4:str4
  </code></pre>