<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="145px"
Width="279px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" οnclick="Button1_Click" Text="Button" />
- protected void Button1_Click(object sender, EventArgs e)
- {
- //Response.Write(this.TextBox1.Text);
- string s = this.TextBox1.Text.Trim();
- string temp = "";
- int count = 1;
- if (s.Contains("/r/n"))
- {
- while (true)
- {
- if (!s.Contains("/r/n"))
- {
- Response.Write("temp " + count + " == >" + s);
- break;
- }
- temp = s.Substring(0, s.IndexOf("/r/n", 0));
- if (temp == "")
- {
- s = s.Remove(0, temp.Length + 2);
- continue;
- }
- Response.Write("temp " + count + " ==> " + temp + "<br/>");
- s = s.Remove(0, temp.Length + 2);
- count++;
- }
- }
- else
- {
- Response.Write("temp " + count + " ==> " + s);
- }
- }