C# String Operator Overloading

前端 未结 7 2018
自闭症患者
自闭症患者 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条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 04:27

    Do you mean the System.String class? That's impossible in C#. You can't add extension operators to an existing class. It's a much requested feature though.

提交回复
热议问题