Can somebody what is the Replace equivalent in ASP.Net..Below is the VB.Net code..I Searched on the net..but not able to do it....I hope so it will be too simple..

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sID As String = "ABC1"
        Dim lId As Integer
        sID = Replace("ABC1", "ABC", "")
        lId = Int(sID)
    End Sub

Recommended Answers

All 4 Replies

Try this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim sID As String = "ABC1"
		Dim lID As Integer
		sID = sID.Replace("ABC", String.Empty)
		lID = CType(sID, Integer)
	End Sub

string.Replace()

string.Replace()

Please use code tags and do not repeat answers.

hi
sknake ,

Which answer not to repeat..Hi sorry to say dat but there is not ctype function in ASP.net + C#,
Instead of dat I use-

lID= Convert.ToInt32(sID);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.