[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 651
  • Last Modified:

string.replace method not replacing strings in vb.net 2

In the example below, the replace method does nothing at all!
Am I using this incorrectly?
Dim mastertemplate As String = Me.txtNewsLetterTemplate.Text
            mastertemplate.Replace("[title]", Me.txtNewsLetterTitle.Text.Trim)

Open in new window

0
bd9000
Asked:
bd9000
2 Solutions
 
PockyMasterCommented:
Replace does not change the string itself, but returns the changed string...
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
so you would need to assign the new value as such
mastertemplate = mastertemplate.Replace("[title]", Me.txtNewsLetterTitle.Text.Trim)
0
 
bd9000Author Commented:
oooh! duh!
I was not thinking
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now