Strip double quotes from a string in .NET

后端 未结 12 2252
抹茶落季
抹茶落季 2020-12-24 04:16

I\'m trying to match on some inconsistently formatted HTML and need to strip out some double quotes.

Current:


         


        
12条回答
  •  半阙折子戏
    2020-12-24 04:58

    I think your first line would actually work but I think you need four quotation marks for a string containing a single one (in VB at least):

    s = s.Replace("""", "")
    

    for C# you'd have to escape the quotation mark using a backslash:

    s = s.Replace("\"", "");
    

提交回复
热议问题