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