Hi PRA,
Please refer below sample.
HTML
<div>
Name :
<asp:TextBox ID="txtId" runat="server"></asp:TextBox>
<asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClick="GetId" />
<asp:Label ID="lblMessage" runat="server" />
</div>
Code
C#
protected void GetId(object sender, EventArgs e)
{
string[] splitxt = txtId.Text.Split(',');
string id = "";
for (int i = 0; i < splitxt.Length; i++)
{
id += splitxt[i].Split('-')[1] + ",";
}
lblMessage.Text = "Id is :" + id.Remove(id.Length - 1);
}
VB.Net
Protected Sub GetId(ByVal sender As Object, ByVal e As EventArgs)
Dim splitxt As String() = txtId.Text.Split(","c)
Dim id As String = ""
For i As Integer = 0 To splitxt.Length - 1
id += splitxt(i).Split("-"c)(1) & ","
Next
lblMessage.Text = "Id is :" & id.Remove(id.Length - 1)
End Sub
Screenshot