有一个String.Format
函数在文档中被称为Format
VB6 的模拟函数。还有Format
来自VisualBasic
命名空间的功能是为了兼容性而提供的,并且基本上具有与String.Format
.
事实上,这两种格式的日期和数字。
但是 VB6 的函数也可以格式化字符串:
? format$("hi there", ">")
HI THERE
? format$("hI tHeRe", "<")
hi there
? format$("hi there", ">!@@@... not @@@@@")
HI ... not THERE
String.Format
就我而言,无法做到这一点,新的Format
. 我在兼容性文档中也找不到任何提及Format
VB6 功能的某些部分丢失的信息,似乎该功能已被“默默地”弃用。
框架中有什么可以做这种格式的吗?