ASP.NET Parsing String

ASP.NET Code behing
default.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Netstair Tools!
    </h2>
    <p>
        <asp:Label ID="label1" Text="John, Doe" runat="server"></asp:Label>
    </p>    
    <p>
        Parsed Left: <asp:Label ID="label2" runat="server"></asp:Label>
    </p>
    <p>
        Parsed Right: <asp:Label ID="label3" runat="server"></asp:Label>
    </p>    
</asp:Content>
default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ncTools;   //- Make sure this ncTools.dll is in your BIN folder

/// <summary>
/// ASP.NET Code behing
/// Download the .DLL Assembly ncTools.zip
/// default.aspx / default.aspx.cs
/// </summary>

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //- Parse String entered in label1 by locating the comma separation
        //- Parse Left String
        label2.Text = DFO.ParseTheString(label1.Text, ",", eParsing.Left);
        //- Parse Right String
        label3.Text = DFO.ParseTheString(label1.Text, ",", eParsing.Right);
    }
}
Download the .DLL Assembly ncTools.zip

Add Feedback