What about creating a class who's only property is a string? THen on the
set access modifier you can run your regex and validation routine against it
and ensure that's what you want. You could also make it an indexed property
and only let it have one value so you cna make it the default property
"Mike" <no**@none.com> wrote in message
news:u8**************@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to write a string-like class that will only allow certain
string values, (for example, specified with a regular expression). I'd
still like it to behave like a string, I just don't want to ensure the
validity of it's value. Since you can't inherit from string, what would
be the best way to approach this?
Mike