c# 去除字符串中的换行符 "\r\n"

有点特别的是,在我们使用replace进行换行符的替换时,需要按顺序进行。

private string cleanString(string newStr)
    {
        string tempStr = newStr.Replace("\n", "");
        return tempStr = tempStr.Replace("\r", "");
    }

 

posted @ 2014-01-15 03:08  被谋杀的诗篇  阅读(7191)  评论(0编辑  收藏  举报