C#清楚第一个字前的换行和空格
C#清楚第一个字前的空格和换行,是用正则表达式吗?谢谢!
------解决方案--------------------清楚换行标记 
 .Replace( "\r\n ", " ");
------解决方案--------------------是一个字符串把? 
 string str			 
 str= " /n接分 西西 ";			 
 str=str.Remove(0,3);			 
 MessageBox.Show(str);     
 如果你要从字符后面删的话用 
 str=str.Substring(0,str.Length-1); 
 减几就是去几个字符
------解决方案--------------------好象棍棍打反了,还多减了一个字符用str=str.Remove(0,2);就行了     
 再加个\r吧 
 string str			 
 str= " \r\n接分 西西 ";			 
 str=str.Remove(0,3);			 
 MessageBox.Show(str);   
 str的值就边为 "接分 西西 "了
------解决方案--------------------Regex ex = new Regex(@ "^[\n\s]* "); 
 string s =  "   \n abc de ";   
 string sNew = ex.Replace(s,  " ");   
 Console.WriteLine(s); 
 Console.WriteLine(sNew); 
 Console.ReadKey();   
 // 测试完毕通过。
------解决方案--------------------试试: 
 		string sourceString = @ "  fgsafda  adfasdf "; 
 		string pattern = @ "^[\s\n\t]+([\s\S]*) "; 
 		System.Text.RegularExpressions.Match result = Regex.Match(sourceString,pattern,System.Text.RegularExpressions.RegexOptions.IgnoreCase);  		 
 		if (result.Success) 
 		{ 
 		//提示正确信息 
 			WL( "正确: " + result.Groups[1].Value);//输出 
 		}
------解决方案--------------------对了,还有一个\r 
 第一行改:Regex ex = new Regex(@ "^[\n\s\r]* ");
------解决方案--------------------string.TrimStart( "\r\n  ".toArray()); 
 string.TrimEnd( "\r\n  ".toArray()); 
 string.Trim( "\r\n  ".toArray());