Remove '\' char from string c#

后端 未结 10 1051
谎友^
谎友^ 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

             while ((line = stringReader.ReadLine()) != null)
             {
                 // split the lines
                 for (int c = 0; c < line.Length; c++)
                 {
                     line = line.Replace("\\", "");
                     lineBreakOne = line.Substring(1, c - 2);
                     lineBreakTwo = line.Substring(c + 2, line.Length - 2);
                 }
             }
    

提交回复
热议问题