Tigerwood2006

I am using the split method of string variable to sub-divide the string by supplying it with a delimeter. I am puzzled by how to specify a double quote as such a delimeter, does anyone how to do that




Re: Visual Basic Express Edition double quote as delimiter

bdbodger

I think you need to use 4 double quotes like this """"





Re: Visual Basic Express Edition double quote as delimiter

Solitaire

You could use Chr(34) which is the ASCII value of the quotation character.






Re: Visual Basic Express Edition double quote as delimiter

Tigerwood2006

Thanks for the reply. I tested them they both worked , also I found another way to do it, as below

abc=abc.replace(chrw(&H22), "")

same result as these:

abc=abc.replace("""", "")
abc=abc.replace(chr(34), "")


Also, just for reference,

character for single quote is: Chrw(&H27)
character for left single quote is: Chrw(&H2018)
character for right single quote is: Chrw(&H2019)
character for left double single quote is: Chrw(&H201C)
character for right double single quote is: Chrw(&H201D)






Re: Visual Basic Express Edition double quote as delimiter

Martin Xie - MSFT

Thank you Tigerwood for your valuable feedback!

Regards,

Martin






Re: Visual Basic Express Edition double quote as delimiter

Solitaire

You can use the decimal values just as well as the hexadecimal values of the Unicode symbols:

Code Block

Sub Main()

Console.WriteLine("Quotation marks using Hex values")

Console.WriteLine("Double quote: " & ChrW(&H22))

Console.WriteLine("Single quote: " & ChrW(&H27))

Console.WriteLine("Left single quote: " & ChrW(&H2018))

Console.WriteLine("Right single quote: " & ChrW(&H2019))

Console.WriteLine("Left double quote: " & ChrW(&H201C))

Console.WriteLine("Right double quote: " & ChrW(&H201D))

Console.WriteLine()

Console.WriteLine("Quotation marks using Dec values")

Console.WriteLine("Double quote: " & ChrW(32))

Console.WriteLine("Single quote: " & ChrW(39))

Console.WriteLine("Left single quote: " & ChrW(8216))

Console.WriteLine("Right single quote: " & ChrW(8217))

Console.WriteLine("Left double quote: " & ChrW(8220))

Console.WriteLine("Right double quote: " & ChrW(8221))

Console.ReadLine()

End Sub