Finding and Replacing Text in a TextBox

bunze

Well-known member
Joined
Aug 4, 2005
Messages
52
Location
Adirolf
Programming Experience
1-3
I am putting some text into a textbox and in the text I need (I literally mean, need) some of the text to have quotations around in. The problem is that do to vb.net I cant have textbox.text = "Bob said "hello"" and etc, "hello" will give me an error. So I am put it like this. textbox.text = "Bob said 'hello'" with the single ' mark. Now is there some code I can put it to filter through the textbox and replace any ' with " ? Thanks!
 
I think you use double double quotes for this, so you would use textbox.text = "bob said ""hello"""

I seem to remember that work last time I used it :)
 
The problem is that in my code, the "text" is broken up and split between variables and procedures, so I cant use double quotes. The first quote would be in one procedure and the ending quote in the next procedure.
 
No, I can't becuase it will see 3 " marks and add a forth where I don't want it.

I need to replace the ' with " AFTER I put it all in the text box, there is no other way around it
 
If I do:
txtLogBox.Text = "testing..."""

txtLogBox.Text = txtLogBox.Text + "whether"" quotes can appear like this"

it works fine, displaying:

testing..."whether" quotes can appear like this
 
Back
Top