Wednesday, 21 August 2013

How do I extend the String class?

How do I extend the String class?

Extending core classes in javascript is dead easy. I get the impression
it's not quite so easy in C#. I was wanting to add some things to the
String class so that I could do stuff like:
string s = "the cat's mat sat";
string sql = s.smartsingleQuote();
thus giving me
the cat''s mat sat
Is that even feasible, or do I have to write a function for that?

No comments:

Post a Comment