title: displayformatattribute to custom format a string
body: <p>I want to be able to mark properties in my viewmodel to be formatted using a custom format when displayed in my MVC view.</p>
  
  <p>I assume I need my own displayformatattribute and set the displayformat but I am not sure how to set this displayformat or where. If I want to show a number as currency it is easy, just set DataFormatString to "{0:C}" in the constructor of the attribute.</p>
  
  <p>But if for example I want to mask email addresses (so remove the domain name), how would I do this using either a displayformatattribute or maybe a datatypeattribute?
  So it is a string field that I want to transform.
  I know there are other approaches e.g. custom display templates but then I would lose some of the inbuilt htmlhelper functionality. I just want to change the format of the string nothing else. And preferably make it as simple as adding an attribute to those fields that need masking</p>
  
  <p>The DataFormatString doesn't seem to be able to take a custom formatter?</p>
  
  <p>cheers
  Phil</p>