简体   繁体   中英

Creating a custom method of a System Type

I am just curious if there is a way of adding a method to the system type ie

char.IsNull(value) 

i know a similar thing can be achieved by using an extension method but to call that i have to put 'M'.IsNull()

No, basically; there is an ongoing discussion (titled "extension everything") on the topic of whether to add such a feature, but right now (including the current C# 8 previews): no.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM