Minimalist array creation in c#

Posted by sipwiz on Stack Overflow See other posts from Stack Overflow or by sipwiz
Published on 2009-05-29T05:24:25Z Indexed on 2010/04/25 5:33 UTC
Read the original article Hit count: 237

Filed under:
|

I've always wanted to be able to use the line below but the C# compiler won't let me. To me it seems obvious and unambiguos as to what I want.

myString.Trim({'[', ']'});

I can acheive my goal using:

myString.Trim(new char[]{'[', ']'});

So I don't die wondering is there any other way to do it that is closer to the first approach?

© Stack Overflow or respective owner

Related posts about c#

Related posts about arrays