Writing a code that rejects strings and accepts all other datatypes using subtraction method
How do you create a dll file and write a program accepting all values of any datatype except strings using the subtraction method.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

AlanRank #669 · 3.6K reputationPosted Oct 12, 2008, 10:06 AM EDT
If you mean the subtraction operator ( '-'), then the string class doesn't support it anyway. It is supported by all the numeric types and by other framework types such as DateTime and TimeSpan. It could also be supported by custom types using operator overloading.
However, if you're trying to write a generic subtraction method in a class library, then this is virtually impossible because there's no 'constraint' which ties all these types together. They'll probably all implement IComparable (as do string and char) but there are other types which implement IComparable which do not have a subtraction operator.
What exactly are you trying to achieve here?