c# - string user function -


How can I add a custom function to a string type

> string testing = "hello"; Test.userFn ("world"); Public string userFn (strng str) {return "" + str; }

  namespace extension rule (public Static class) MyExtensions {public static string userFn (this string str) {return "" + str; }}}  

Comments