title: Generic Method - Cannot implicitly convert type 'string' to T
body: <p>May be a simple question..</p>
  
  <p>I have an interface:</p>
  
  <pre><code>public interface ISanitizer
  {
      T Sanitize&lt;T&gt;(T data_);
  }
  </code></pre>
  
  <p>And an implementing class:</p>
  
  <pre><code>    public class BasicFilenameSanitizer : ISanitizer
      {
  
          private readonly String m_replacementCharacter = String.Empty;
  
          public BasicFilenameSanitizer(String replacementCharacter_)
          {
              if (replacementCharacter_ == null)
              {
                  throw new ArgumentNullException("replacementCharacter_");
              }
  
              m_replacementCharacter = replacementCharacter_;
          }
  
  
          public virtual T Sanitize&lt;T&gt;(T filename_)
          {
              if (filename_ == null)
              {
                  throw new ArgumentNullException("filename_");
              }
  
              Regex invalidCharacterRegex =
                  new Regex(String.Format("[{0}]", Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars()))));
  
  //error occurs here
              return Regex.Replace(filename_.ToString(), invalidCharacterRegex.ToString(), m_replacementCharacter);
          }
  
  }
  </code></pre>