title: Using a delegate for value transformation
body: <p>I want to develop a basic class that holds a string value and I want to pass a transformation rule how this value should be stored as an int value.</p>
  
  <p>When I'm not completely wrong this should be possible using some kind of delegate. Unfortunately I have no idea how to begin and what to search the internet for.</p>
  
  <p>Here a simple example:</p>
  
  <pre><code>    class MyClass
      {
        public string InputString { get; private set; }
        public int OutputValue { get; set; }
        public MyClass(string inputString)
        {
          this.InputString = inputString;
        }
  
        //I suspect that I need a method here taking some kind of delegate?
      }
  
      MyClass mC = new MyClass("abcd");
  
      //here I now want to pass something to mC saying that each character should 
      // be transformed to its ascii value and be added to a total value
  
      //or another object should transform abcd interpreting it hexadecimal
  </code></pre>