Search code examples
c#stringdouble-quotesstring-literals

C# string with multiple double quotes & "/" slashes


I have a string like this

'Name.ToLower().Contains ("") And Created < ("05/12/2022 01:41:16") And Disabled == false'

How to deal with this in C#?

I've tried prepending with @""" etc.

dotnet fiddle


Solution

  • var a = @"'Name.ToLower().Contains ("""") And Created < (""05/12/2022"") And ExpandOnStart == false'";
    

    like this?