Amnesh Goel
Amnesh Goel

Reputation: 2655

Unable to remove substring from main string having number of double quotes in c#

I have following main string and I'm trying to remove the highlighted part from main string.

enter image description here

Following is the code that I'm using. I used a slash and additional double quotes with each double quote, but no luck :(

string a = @""" & IIF(Parameters!RoleID.Value = 4,""";
string b = "\", \"\") & \"";
outputString = outputString.Replace(a, " ");
outputString = outputString.Replace(b, " ");

Any idea, what will help? TIA!!

Upvotes: 0

Views: 47

Answers (1)

Cyral
Cyral

Reputation: 14153

You do not need to escape & as &.

string a = @""" & IIF(Parameters!RoleID.Value = 4,""";
string b = "\", \"\") & \"";

Upvotes: 2

Related Questions