C
craigkenisston
I need an special string that have a fixed capacity and that
automatically(silently) trims extra space.
MySpecialString str = new MySpecialString(10);
str = "1234567890ABCDE"
Console.WriteLine(MySpecialString.ToString())
// output "1234567890" i.e. trimes the "ABCDE"
The stringbuilder has the capability of specify a capacity, but this
does nothing just to set an initial size.
If I put a string larger than its capacity it just grows.
So, is there any special class that does this?
If there isn't. Can I inherit from string and create a class that does
this?
Thanks in advance,
automatically(silently) trims extra space.
MySpecialString str = new MySpecialString(10);
str = "1234567890ABCDE"
Console.WriteLine(MySpecialString.ToString())
// output "1234567890" i.e. trimes the "ABCDE"
The stringbuilder has the capability of specify a capacity, but this
does nothing just to set an initial size.
If I put a string larger than its capacity it just grows.
So, is there any special class that does this?
If there isn't. Can I inherit from string and create a class that does
this?
Thanks in advance,

