C# - initial.object within argument?
Is it possible to initialize an object that I want开发者_运维知识库 to pass as an argument without writing it on a special line?:
String a="test";
a.TrimStart(new char [] X=['a'])
yes you can, but you can't assign name to it. Try:
a.TrimStart(new char[] {'a'})
a.TrimStart(new char[] { 'a' });
You can even leave out the "char":
a.TrimStart(new[] { 'a' });
精彩评论