How to replace an Image with a Text?

2

I'm developing a project where I need to replace an image with a certain text when it is not loading.

Example: If the image does not load, display a message stating that the image could not be obtained. Is this possible? My image is popping up inside a RichTextBox , along with text.

    
asked by anonymous 03.02.2014 / 13:07

1 answer

1

I found the answer to my problem in the stack overflow in English. This case worked for what I needed: Answer

If you do not want to navigate to the link, here is the piece of code:

    Dim input As String = "test<img>" ' your data here
    Dim imgRegex As New Regex("<img[^>]*>", RegexOptions.IgnoreCase)
    Dim output As String = imgRegex.Replace(input, "")
    
03.02.2014 / 17:44