标签:style blog color os ar for 文件 sp div
1 //修改文件名 2 private static void ReviseFileName(string[] files) 3 { 4 for (int i = 0; i < files.Length; i++) 5 { 6 string file = files[i]; 7 string newFile = RemoveBlank(file); 8 File.Move(file, newFile); 9 } 10 } 11 //去除字符串中的空格 12 private static string RemoveBlank(string sourceString) 13 { 14 char[] p_char = sourceString.ToCharArray();//得到字符数组 15 IEnumerator p_ienumerator_char = p_char.GetEnumerator();//得到枚举器 16 StringBuilder p_stringbuilder = new StringBuilder(); 17 while (p_ienumerator_char.MoveNext())//开始枚举 18 { 19 p_stringbuilder.Append((char)p_ienumerator_char.Current!=‘ ‘?p_ienumerator_char.Current.ToString():string.Empty); 20 } 21 return p_stringbuilder.ToString(); 22 }
标签:style blog color os ar for 文件 sp div
原文地址:http://www.cnblogs.com/wangzianan/p/4022277.html