|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Replace " character in stringCan anyone help me, I'm trying to replace any double quotes in a
textbox with a different character. mystring = Replace(TextBox.Text , " , "*") I've tried chr(34) and """"" with no luck. Thanks Pete "xla76" <pete.for***@gmail.com> schreef in bericht Strange, something like:news:1163946251.355105.251600@j44g2000cwa.googlegroups.com... > Can anyone help me, I'm trying to replace any double quotes in a > textbox with a different character. > > mystring = Replace(TextBox.Text , " , "*") > > I've tried chr(34) and """"" with no luck. > > Thanks > Pete > TextBox1.Text = "Try to replace "" by #" TextBox2.Text = Replace(TextBox1.Text, Chr(34), "#") works without problems for me. Groeten, Jaap Thanks Jaap,
nothing like a simple typo to throw a spanner in the works - but at least you confirmed for me that it should work. "xla76" <pete.for***@gmail.com> schrieb: Use 'ControlChars.Quote' or '""""' (a string literal containing a single > Can anyone help me, I'm trying to replace any double quotes in a > textbox with a different character. > > mystring = Replace(TextBox.Text , " , "*") > > I've tried chr(34) and """"" with no luck. double quote character, which is escaped by placing two consecutive double quote characters inside the VB string literal). -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> "xla76" <pete.for***@gmail.com> wrote in message This works fine for me in the context of a Windows application:news:1163946251.355105.251600@j44g2000cwa.googlegroups.com... > Can anyone help me, I'm trying to replace any double quotes in a > textbox with a different character. > > mystring = Replace(TextBox.Text , " , "*") > > I've tried chr(34) and """"" with no luck. > > Thanks > Pete > Dim vale As String vale = Replace(Textbox.Text, """", "*") Textbox.Text = vale If it fails for you, perhaps you could supply details such as application type and template you're using? I always use (or a constant derived from it) ControlChars.Quote
as it reads so much clearer guy Show quoteHide quote "xla76" wrote: > Can anyone help me, I'm trying to replace any double quotes in a > textbox with a different character. > > mystring = Replace(TextBox.Text , " , "*") > > I've tried chr(34) and """"" with no luck. > > Thanks > Pete > >
While not starting a debate BUT
Syntax error in INSERT INTO statement textbox help VB2005 PRINTER INFORMATION Newbie - MDI Question Save Changes in VB.NET 2005 with Access 2003 --- Not using any Binding Navigator Getting the generated name attribute for use in JavaScript syntax to compare data from text field, when adding a record, to a field in a table for duplicates Blinking button Hide property of component |
|||||||||||||||||||||||