check for " in string vb.net

.net, c#, special-characters, vb.net

Solution

... partnerItem.Contains("""") ...

I believe VB.Net escapes double-quotes with double-quotes. Thanks to the code-coloring on this site, your syntax is correctly highlighted with this change.

If partnerItem.Contains("*") Or partnerItem.Contains("""") Then
   isBad = True
   reportError(i + 1, colDetails(0), colDetails(1), "Field cannot contain " & PARTNER_ITEM_INVALID_CHARACTERS & " characters.")

Problem

I am struggling to check for a " in a string in vb.net. Could anybody suggest a way to look for " in string as we do in c# using " \" " I have tried with, \" and "" but of no use. ``` If partnerItem.Contains("*") Or partnerItem.Contains(""") Then isBad = True reportError(i + 1, colDetails(0), colDetails(1), "Field cannot contain " & PARTNER_ITEM_INVALID_CHARACTERS & " characters.") ```

Original source