How to validate format for string.Format method

后端 未结 4 808
感情败类
感情败类 2021-02-14 05:15

string.Format has following method signature

string.Format(format, params, .., .. , ..);

I want to pass custom format each time like



        
4条回答
  •  粉色の甜心
    2021-02-14 05:59

    You should use regular expressions for syntax checking and you may use some semantic checking as well.

    Regular expression should be: (*{\d+}*)+

提交回复
热议问题