Search

Tuesday, May 27, 2014
0 comments

Example of Append string using StringBuilder class in asp.net

6:09 AMTuesday, May 27, 2014
 <form id="form1" runat="server">
    <asp:Button ID="Button1"
     runat="server"
     onclick="Button1_Click"
     Text="Click"
        Width="74px" BackColor="#FF6666" />
    <div style="width: 93px">
   
        <asp:Label ID="Label1"
         runat="server"
         Text="Label" BackColor="Yellow" ForeColor="Black"></asp:Label>
   
    </div>
    </form>

 Code Behind

 protected void Button1_Click(object sender, System.EventArgs e)  
       {

        StringBuilder stringA = new StringBuilder();
        stringA.Append("those are text. ");
        StringBuilder stringA2 = new StringBuilder(" another text.");

        stringA.Append(stringA2);

        Label1.Text = stringA.ToString(); 
    }

Code Generate the following outputExample of Append string using StringBuilder class in asp.net

Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top