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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -