Remove '\' char from string c#

后端 未结 10 1060
谎友^
谎友^ 2020-12-15 03:16

I have the following code

string line = \"\"; 

while ((line = stringReader.ReadLine()) != null)
{
    // split the lines
    for (int c = 0; c < line.Len         


        
10条回答
  •  庸人自扰
    2020-12-15 03:27

    You can use String.Replace which basically removes all occurrences

    line.Replace(@"\", ""); 
    

提交回复
热议问题