How to embed double quote in a string? 
Author Message
 How to embed double quote in a string?

I'm trying to write a CGI application that needs to send a string with
an embedded double quote in it.  I can't seem to get Visual Basic to
accept it.  

(On UNIX, you can put a back slash in front of the double quote and it
will be interpreted as the character double quote, not as the end of
the string.)

Is there a way to do something like this for VB?

Thanks,
Sherrill



Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

Quote:

> I'm trying to write a CGI application that needs to send a string with
> an embedded double quote in it.  I can't seem to get Visual Basic to
> accept it.

> (On UNIX, you can put a back slash in front of the double quote and it
> will be interpreted as the character double quote, not as the end of
> the string.)

> Is there a way to do something like this for VB?

> Thanks,
> Sherrill

myString = "here is a double quote" + chr(34)

Paul



Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

Quote:
> I'm trying to write a CGI application that needs to send a string with
> an embedded double quote in it.  I can't seem to get Visual Basic to
> accept it.  

Use the ASCII number for the double-quote - 34.  Try this:

MsgBox Chr$(34)

--
Andrew Enfield

Senior, Computer Engineering
University of Washington



Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

Maybe I don't understand the question?

   Label1.caption = "A string with 'double quote' ("") within it."

Displays the following in Label1:
        A string with 'double quote' (") within it.
=-=-=-=-=

Quote:
>I'm trying to write a CGI application that needs to send a string with
>an embedded double quote in it.  I can't seem to get Visual Basic to
>accept it.  

>(On UNIX, you can put a back slash in front of the double quote and it
>will be interpreted as the character double quote, not as the end of
>the string.)

>Is there a way to do something like this for VB?

>Thanks,
>Sherrill

=-=-=-=-=-=-=-=-=
Harry Lichtbach
Almaden Unlimited
San Jose, CA. USA


Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?


Quote:
> I'm trying to write a CGI application that needs to send a string with
> an embedded double quote in it.  I can't seem to get Visual Basic to
> accept it.  

Try either

" This is a ""quote"" inside a quote "

(double quote means embedded quote) or

" This is a " & Chr$(34) & "quote" & Chr$(34) & " inside a quote "

Quote:
> (On UNIX, you can put a back slash in front of the double quote and it
> will be interpreted as the character double quote, not as the end of
> the string.)

Of course you mean that when using _C_ you can do this. UNIX has nothing to
with it.

--
VB Info: http://home.sn.no/~balchen/vb/visual.htm
FAQ: http://home.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

Hi Sherrill,

I think that if you double your double quote you should be able to embedded
it in a string.

For example, if you want to write : I am a "double" quote string.
write it like that : "I am a ""double"" quote string."

Hope it'll help.

Regards.

Jr?me Lyperre



Quote:
> I'm trying to write a CGI application that needs to send a string with
> an embedded double quote in it.  I can't seem to get Visual Basic to
> accept it.  

> (On UNIX, you can put a back slash in front of the double quote and it
> will be interpreted as the character double quote, not as the end of
> the string.)

> Is there a way to do something like this for VB?

> Thanks,
> Sherrill



Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

Try this.  Create an app.  Put a textbox call txtTBox.  In the form_load
event put

        txtTBox.Text = "This is a ""quoted"" string"

Now run it.

Shelly



Quote:
> I'm trying to write a CGI application that needs to send a string with
> an embedded double quote in it.  I can't seem to get Visual Basic to
> accept it.  

> (On UNIX, you can put a back slash in front of the double quote and it
> will be interpreted as the character double quote, not as the end of
> the string.)

> Is there a way to do something like this for VB?

> Thanks,
> Sherrill



Fri, 09 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?


Quote:
> I'm trying to write a CGI application that needs to send a string with
> an embedded double quote in it.  I can't seem to get Visual Basic to
> accept it.  

> (On UNIX, you can put a back slash in front of the double quote and it
> will be interpreted as the character double quote, not as the end of
> the string.)

> Is there a way to do something like this for VB?

> Thanks,
> Sherrill

Hai Sherrill,

Here's you answer:

Just add the ascii value to the string will work fine i think..

code sould look something like this:

dim s as string

s = "some data, next wordt will be delimited "+chr$(34)+"look"+chr$(34)+" this is the end"

Hope this will be of some help.

Peter van Dam



Sat, 10 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

try this :

text1.text = "I'm a " & chr$(34) & "boy" & chr$(34)



Mon, 12 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?


: I'm trying to write a CGI application that needs to send a string with
: an embedded double quote in it.  I can't seem to get Visual Basic to
: accept it.  
                        .
                        .
: Is there a way to do something like this for VB?

--

Use 2 double quotes in a row, e.g.

m$ = "Mary said, ""Hello"""

Regards,
LenW

************************************************************
* Len Weltman   PH (703)834-5000 X2789   FAX (703)318-7900 *
* TASC          12100 Sunset Hills Rd    Reston, VA 20190  *
*                                                          *
* A little nonsense now and then is relished by the wisest *

************************************************************



Tue, 13 Apr 1999 03:00:00 GMT  
 How to embed double quote in a string?

Quote:

>: I'm trying to write a CGI application that needs to send a string with
>: an embedded double quote in it.  I can't seem to get Visual Basic to
>: accept it.  
>                    .
>                    .
>: Is there a way to do something like this for VB?

mystring$="first line" & chr(34) & "second line" & chr(34)

gr. walther

----- cut here -----
Walther Musch
Tilburg University



Fri, 16 Apr 1999 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Embedding Double Quotes in a String -- How?

2. How to embed both single and double quotes in strings

3. Concatenate string with single and double quotes

4. working with strings containing single- and double-quotes

5. Filter-string with single/double quotes in Restrict/Find method

6. setting a string equal to double quotes

7. Double quotes in string

8. Simple string and double quote question...

9. How to use " (double-quote) in string

10. double quotes character in a string

11. Quick question about double quotes in text strings?

12. Double Quote/Apostropie in strings

 

 
Powered by phpBB® Forum Software