Why isn't quotation Mark between quotation Mark(String defining) possible?

K

kimiraikkonen

I'm using VB.NET 05 express and i have to declare a simple string
like:

Dim mystring As String
mystring = " " "


But that doesn't work.



In order to define quotation mark, strings are entered between
quotation mark
of VB.NET enviroment:


For example


mystring = "something" is OK but mystring = " " " doesn't work


How can i fix it? How can i define a quotation mark as string?


Thanks.
 
C

Charlie Brown

I'm using VB.NET 05 express and i have to declare a simple string
like:

Dim mystring As String
mystring = " " "

But that doesn't work.

In order to define quotation mark, strings are entered between
quotation mark
of VB.NET enviroment:

For example

mystring = "something" is OK but mystring = " " " doesn't work

How can i fix it? How can i define a quotation mark as string?

Thanks.

Add a quotation mark prior to that mark.

mystring = " "" "

This can be confusing to read in code though if you use it alot, so
you may want to use a constant to represent the quotation mark
instead.

Const quote as String = " "" "

mystring = "some text" & quote & "some more text" & quote

This may already be a constant in vb for this, but i can't remember,
someone else I'm sure will chime in with another way...
 
K

kimiraikkonen

Add a quotation mark prior to that mark.

mystring = " "" "

This can be confusing to read in code though if you use it alot, so
you may want to use a constant to represent the quotation mark
instead.

Const quote as String = " "" "

mystring = "some text" & quote & "some more text" & quote

This may already be a constant in vb for this, but i can't remember,
someone else I'm sure will chime in with another way...- Hide quoted text -

- Show quoted text -

Hi Charlie and thanks;

mystring = " "" " wasn't useful for me due to 2 spaces at the
beginning and end, but mystring = """" worked! (4 consecutive
quatation marks)

Thanks.
 
H

Hal Rosser

kimiraikkonen said:
I'm using VB.NET 05 express and i have to declare a simple string
like:

Dim mystring As String
mystring = " " "


But that doesn't work.
try
mystring = chr(34)
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Herfried said:
=> 'ControlChars.Quote'.

And I can't figure out what possessed them to put the quotation mark
among the control characters... ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top