We help IT Professionals succeed at work.

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

Comment
Watch Question

Replace does not change the string itself, but returns the changed string...
Daniel ReynoldsSoftware Applications Developer / Integrator
CERTIFIED EXPERT
Commented:
so you would need to assign the new value as such
mastertemplate = mastertemplate.Replace("[title]", Me.txtNewsLetterTitle.Text.Trim)

Author

Commented:
oooh! duh!
I was not thinking

Explore More ContentExplore courses, solutions, and other research materials related to this topic.