How to validate format for string.Format method

后端 未结 4 809
感情败类
感情败类 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:50

    As long as you're only passing in 1 argument, you can look search custFormat for {0}. If you don't find it, it's invalid.

提交回复
热议问题