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

iphone - How do I make a UIPickerView in a UIActionSheet -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -