Quotation Mark in string

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

Guest

Hi,

How do I trim double quotation mark " in a string? Or, how
do I match pattern if the string has double quotation mark
already like "string"? Thanks in advance.

Hugh
 
this should do it

Dim s As String = "this is a string w "" in it and at the end """
s = s.Trim(""""c)
Debug.WriteLine(s)

hope it helps

eric
 
* said:
How do I trim double quotation mark " in a string? Or, how
do I match pattern if the string has double quotation mark
already like "string"? Thanks in advance.

Encode each double quotation mark with /two/ double quotation marks
inside the string literal:

\\\
MsgBox("He said: ""Hello World!""")
///

For a string containing a single quotation mark type '""""' (without the
"'"s) or use 'ControlChars.Quote'.
 
Hi Eric,

I tried your code, the quotation after W is still there.
Does it only trim one charactor at once? Thanks.

Hugh
 
Back
Top