C# String Operator Overloading

前端 未结 7 2041
自闭症患者
自闭症患者 2020-12-19 04:02

G\'Day Mates -

What is the right way (excluding the argument of whether it is advisable) to overload the string operators <, >, <= and >= ?

I\'ve trie

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 04:47

    The simple answer is that you can't; there's no way to modify the operators for another class. Partial classes are only allowed for classes that are both declared partial in all files and defined in the same assembly.

提交回复
热议问题