c# - Is it possible to derive from System.String? -


this question has answer here:

i deriving class string. wont allow me inherit class:what need if want inherit this?

public class : string {    //class definition } 

you cannot inherit string because sealed. if have extend provided functionality, have 2 options:

  • write wrapper class around string , implement methods yourself.
  • use extension methods

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -