Parsing formatted string

前端 未结 6 773
渐次进展
渐次进展 2020-12-03 14:12

I am trying to create a generic formatter/parser combination.

Example scenario:

  • I have a string for string.Format(), e.g. var format = \"{0}-{1}\
6条回答
  •  忘掉有多难
    2020-12-03 14:36

    It's simply not possible in the generic case. Some information will be "lost" (string boundaries) in the Format method. Assume:

    String.Format("{0}-{1}", "hello-world", "stack-overflow");
    

    How would you "Unformat" it?

提交回复
热议问题