fork download
  1. using System;
  2.  
  3. public static class StringExtensions {
  4. // string is an existing class! :O
  5. public static string Foo(this string x) {
  6. return x + "hahaha";
  7. }
  8. }
  9.  
  10. public static class Program {
  11. public static void Main(string[] args) {
  12. // just use . notation! :O
  13. Console.WriteLine("{0}", "lol".Foo());
  14. }
  15. }
  16.  
Success #stdin #stdout 0.02s 33912KB
stdin
Standard input is empty
stdout
lolhahaha