将用空格,跳格,回车隔开的字符串,转化成以逗号(,)隔开

/// <summary>
   /// 替换字符串中的以下字符为","
   /// "\n"   "\r"   "\t"   " "--(空格)
   /// </summary>
   /// <param name="strInput"></param>
   /// <returns></returns>
   public static string ClearString(string strInput)
   {
       string strResult = strInput.Replace("\n",",");
       strResult = strResult.Replace("\r", ",");
       strResult = strResult.Replace("\t", ",");
       strResult = strResult.Replace(" ", ",");
       return strResult;
   }

posted on 2010-11-25 16:40  冰危节奏  阅读(1049)  评论(0)    收藏  举报

导航