且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用变量作为 Sprintf 的格式化字符串?

更新时间:2023-11-15 18:10:46

所以你实际上需要创建一个StringFormat,它的函数类型如下

So you actually need to create a StringFormat which has a function type as follows

> sprintf (Printf.StringFormat<string->string>("Hello %s")) "World";;
  val it : string = "Hello World"

6.3.16 的规范,显示了一个例子.

In Section 6.3.16 of the spec, an example of this is shown.