Results 1 to 2 of 2

Thread: javascript prototype functionality?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    1

    Question javascript prototype functionality?

    i'm curious if there is a way in vb.net to accomplish what javascript offers with prototyping, where you can add custom methods to a built-in class. in particular, i wanted to add some custom methods to the string class. i thought about inheritence, but it doesn't look like you can create a class that inherits the string class.

    any ideas?

    thanks,

    glenn

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You can create a new class, and implement all the methods and properties of the string class. Then just add your custom ones. Basically you would have a string variable in your class, then when someone calls a method, you would in turn call your string variables corrisponding method. Like you said, I don't think you can inherit the string class by normal means.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width