Overloading string split function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Overloading string split function

    Hi

    Is there a way to overload split function from system.string?

    Thanks

    Regards


  • Armin Zingler

    #2
    Re: Overloading string split function

    "John" <info@nospam.in fovis.co.ukschr ieb
    Hi
    >
    Is there a way to overload split function from system.string?
    Why? What's the target? Usually that's not necessary. If you insist.....
    In VB 2008 there are extension methods. Example:

    Module Module1
    <System.Runtime .CompilerServic es.Extension()_
    Function Split( _
    ByVal value As String, _
    ByVal Whatever As Integer) _
    As String()

    End Function

    End Module


    AZ

    Comment

    • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

      #3
      Re: Overloading string split function

      Besides that, you can not inherit from a sealed class string.

      "Armin Zingler" wrote:
      "John" <info@nospam.in fovis.co.ukschr ieb
      Hi

      Is there a way to overload split function from system.string?
      >
      Why? What's the target? Usually that's not necessary. If you insist.....
      In VB 2008 there are extension methods. Example:
      >
      Module Module1
      <System.Runtime .CompilerServic es.Extension()_
      Function Split( _
      ByVal value As String, _
      ByVal Whatever As Integer) _
      As String()
      >
      End Function
      >
      End Module
      >
      >
      AZ
      >
      >

      Comment

      Working...