title: How to split the Sentence and show in new lines in C# code behind
body: <p>Objective is to split string and show line breaks in the format. 
  <BR/>I have tried using <code>Environment.NewLine</code> but it is not working.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>stringArray = kidsCampDto.Message.Split(",".ToCharArray());
  
  if (stringArray[0].Equals("successful."))
  {
      lblSuccessMessage.ForeColor = System.Drawing.Color.Green;
      lblSuccessMessage.Text = string.Format("Registration &amp; Payment Information:-" +Environment.NewLine
          + "Welcome to kids camp Programs, Successful Registered with Kids camp." + Environment.NewLine
          + "Athlet+e ID: {0} {1}." + Environment.NewLine
          + "Amount paid: ${2}." + Environment.NewLine
          + "Paid By: {3}." + Environment.NewLine
          + "Transaction Id: {4}." + Environment.NewLine
          + "Transaction Date:{5}." + Environment.NewLine
          + "Program: {6}",
          kidsCampDto.AthleteFirstName,
          kidsCampDto.AthleteLastName, stringArray[3], 
          kidsCampDto.CreditCardSelected == true ? "Credit card" : "Bank Account", stringArray[1],
          Convert.ToDateTime(stringArray[2]).ToShortDateString(),
          kidsCampDto.SeasonTrainingProgram.Equals("0") ? "4 weeks" : (kidsCampDto.SeasonTrainingProgram.Equals("1") ? "8 weeks" : "12 weeks"));
  }
  </code></pre>