Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi can you please help me understand why this wouldn work?
VB
Dim input As String = "<img width=147 height=117 src=cid:inlineImage0>"
      Dim start As Integer = input.IndexOf("src=")
      Dim endi As Integer = input.IndexOf(">", start)


      input.Remove(start, (endi + 1) - start)
      input.Insert(start, "src=cid:image001")

my result still looks like the original

Thnks
Posted

1 solution

It doesn't work because strings are immutable. For instance, the input.Remove() method doesn't change the input variable content, instead it creates a new string instance (that you are discarding).

change from
Quote:
input.Remove(start, (endi + 1) - start)
input.Insert(start, "src=cid:image001")

to
VB
input = input.Remove(start, (endi + 1) - start)
input = input.Insert(start, "src=cid:image001")
 
Share this answer
 
Comments
ASJ_SA 24-Mar-15 7:53am    
Thanks.. That was it!!
CPallini 24-Mar-15 7:58am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900