using System;
namespace MyCSharpLearning
{
class TrimMethod
{
public static void Main(string[] args)
{
string txt = Console.ReadLine();
char[] SpaceRemove = { ' ' };
txt = txt.Trim(SpaceRemove);
Console.WriteLine("Your result is: {0}", txt);
Console.ReadLine();
}
}
}
不working..help !!!!!!空間從一個句子中移除,但不工作
'Trim'將裁剪沒有參數的空格。 – Romoku
我已經運行的代碼,它顯示爲[String.Trim]指定的工作(http://msdn.microsoft.com/en-us/library/system.string.trim.aspx)。也許您對其功能的期望與API不匹配? – user7116
我不認爲人們應該downvote一個問題,因爲他們是新的/不明白庫。他們清楚地表明瞭努力,但誤解了修剪的工作原理。 – Gray