How to create a public virtual string ToString(string format) in its class, so that it string.Format("{0:NNP}", x) , for example, to string.Format("{0:NNP}", x)
my method
public virtual string ToString(string format) { if (format == "NNP") return "NNP format"; return ToString(); } is not called with the aforementioned string.Format("{0:NNP}", x) , the standard public override string ToString() class is called instead. How to solve this problem