Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test
- {
- public static string operator +( Test self, string s )
- {
- return s.Length.ToString() + "Miky";
- }
- public static string operator +(string s, Test self)
- {
- return s.Length.ToString() + "Miky";
- }
- }
- class Program
- {
- public static void Main(string[] args)
- {
- Test t = new Test();
- string s = string.Empty;
- s += t + "Lestat";
- Console.WriteLine(s);
- s = string.Empty;
- s = s + t + "Lestat";
- Console.WriteLine(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement