Hi Nauna,
Please refer code.
Namespaces
C#
using System.Text.RegularExpressions;
VB.Net
Imports System.Text.RegularExpressions
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string test = "p-5898-bedrug-jeep-kits-bedtred.aspx".Replace(".aspx", "");
string[] product = Regex.Split(test, @"(\d+)", RegexOptions.None);
string productid = product[1];
string productname = product[2].Substring(1, product[2].Length - 1);
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim test As String = "p-5898-bedrug-jeep-kits-bedtred.aspx".Replace(".aspx", "")
Dim product As String() = Regex.Split(test, "(\d+)", RegexOptions.None)
Dim productid As String = product(1)
Dim productname As String = product(2).Substring(1, product(2).Length - 1)
End Sub
Screenshot