Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check for " in string vb.net

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.")
like image 651
14578446 Avatar asked Dec 15 '22 23:12

14578446


1 Answers

... 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.")
like image 130
Austin Salonen Avatar answered Dec 28 '22 09:12

Austin Salonen