How To name a string variable which contain the sign ""

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a sting which is -- This is a "dog" !
then I needed to named it to a string variable such as
Dim S as string
S = "This is a "dog"! "

But it does not work ,how to make it?
Thanks
 
* "=?Utf-8?B?Smk=?= said:
I have a sting which is -- This is a "dog" !
then I needed to named it to a string variable such as
Dim S as string
S = "This is a "dog"! "

\\\
s = "This is a ""dog""! "
///

Alternatively, you can concatenate the string ('ControlChars.Quote').
 
Hi Herfried,
\\\
s = "This is a ""dog""! "
///

Greath code, I did not know you could this already, did you find this
yourself or did you take this from the poster who did send that 5 hours
before you?

That alternative is of course not a good answer, that does nobody.

:-)

Cor
 
Cor,

* "Cor said:
Greath code, I did not know you could this already, did you find this
yourself or did you take this from the poster who did send that 5 hours
before you?
?!?

That alternative is of course not a good answer, that does nobody.

Mhm... I know at least one programmer (not me) who always uses the
constant and defined his own 'vbQuote' in VB6.

;-)
 
Mhm... I know at least one programmer (not me) who always uses the
constant and defined his own 'vbQuote' in VB6.


Considering the fact that for every string literal you use, .NET will
actually create a new string object, I think it's a good idea to
define your own constants.

I, for example, have a class to define things like single, double
quotes, opening and closing parentheses, etc. Just stuff i use on a
regular basis.
 
* (e-mail address removed) (j2s) scripsit:
Considering the fact that for every string literal you use, .NET will
actually create a new string object, I think it's a good idea to
define your own constants.

I, for example, have a class to define things like single, double
quotes, opening and closing parentheses, etc. Just stuff i use on a
regular basis.

Remember that "hardcoding" the quote character by typing it twice will
/not/ cause any string concatenation, in opposite to concatenating it to
a constant, for example 'vbQuote'.
 
Back
Top