Fastest way to remove chars from string

前端 未结 7 1667
生来不讨喜
生来不讨喜 2020-12-05 13:52

I have a string from which I have to remove following char: \'\\r\', \'\\n\', and \'\\t\'. I have tried three different ways of removing these char and benchmarked them so I

相关标签:
7条回答
  • 2020-12-05 14:46
    string str;
    str = str.Replace(Environment.NewLine, string.Empty).Replace("\t", string.Empty);
    
    0 讨论(0)
提交回复
热议问题