0

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
3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by mansi sharma
0

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
0

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);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.