How to remove comma (,) from string and show in dynamic label in asp.net c#

In this article, we have learn about how to remove comma from string in asp.net using c sharp .we have a string with multiple comma values and we want to remove all commas from our string so this code will be help you.


Code behind:-
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class splieter : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string data = "neeraj, sanjay , dheeraj ";
        string[] arr = data.Split(',');
        foreach (string a in arr)
        {
            Label label = new Label();
            label.Text = a;
            Page.Controls.Add(label);
        }
       
    }
}

Out-Put:-




How to remove comma (,) from string and show in dynamic label in asp.net c# How to remove comma (,) from string and show in dynamic label in asp.net c# Reviewed by NEERAJ SRIVASTAVA on 10:43:00 PM Rating: 5

No comments:

Powered by Blogger.