title: How to split using multiple characters?
body: <p>I am trying to make error free user input. When there is a one split symbol user might type it and create an error which I must fix before executing creating more lines of code. Is there a way of splitting a string using for example <code>$%$</code> instead of just <code>$</code> character?</p>
  
  <p>This is how I do splitting using one character:</p>
  
  <pre><code>if (!lastUsed.EmptyFile())
  {
      string[] allSettings = lastUsed.Text.Split('$');
      int settingCount = 0;
  
      foreach (string setting in allSettings)
      {
          settingCount++;
  
          if (settingCount == 1)
          {
              txtText.Text = setting;
          }
          else if (settingCount == 2)
          {
              if (setting == "0") tbType.SelectedTab = tbInterval;
              else tbType.SelectedTab = tbRange;
          }
          else if (settingCount == 3)
          {
              nudInterval.Value = decimal.Parse(setting);
          }
          else if (settingCount == 4)
          {
              nudMin.Value = decimal.Parse(setting);
          }
          else if (settingCount == 5)
          {
              nudMax.Value = decimal.Parse(setting);
          }
      }
  }
  </code></pre>