string l_strResult = str.Replace("\n", "").Replace(" ","").Replace("\t","").Replace("\r","");
c#去除字符串中的空格,回车,换行符,制表符
原文:http://www.cnblogs.com/wangfuyou/p/7765777.html