Can i create my class that behaves like string class in c#? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can i create my class that behaves like string class in c#?

I want to create a class which is equivalent to String class in c# and use it in place of actual String class in my application. Any thoughts, if it is possible then how and not then why not, this is not an interview question, I m just trying to move my head around this value an reference type nature of Strings in c#. Thanks a lot, you response will really help me understand a very important concepts.

6th Jan 2019, 8:54 AM
Ashok Kumar
Ashok Kumar - avatar
1 Answer
0
I'd better did that using c or c++ language using malloc/free or new/delete functions that allow you to allocate memory by yourself. A string is an array of char, so it can be possible to do that.
6th Jan 2019, 10:29 AM
Théophile
Théophile - avatar