开发者

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' });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜