相关疑难解决方法(0)

相当于 vb.net 中的 vb6.Format 函数,无需使用 Microsoft.Visualbasic.Compatibility.dll

可能重复:
有没有办法以编程方式将 VB6 格式字符串转换为 .NET 格式字符串?

从 vb6 迁移到 vb.net 期间,Format$(1234567, "###,###,###,###") 函数转换为 vb6.Format(1234567,"###,### ,###,###") 函数,在 Microsoft.Visualbasic.Compatibility.dll 中定义。

我不想使用 Microsoft.Visualbasic.Compatibility.dll。.NET 中是否有任何等效项?

提前致谢。

vb.net vb6-migration

5
推荐指数
1
解决办法
1万
查看次数

VB6 格式函数:.NET 中的模拟

有一个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 功能的某些部分丢失的内容,似乎该功能已被“悄悄地”弃用。

框架中有什么东西可以进行这种类型的格式化吗?

.net vb.net string-formatting vb6-migration

4
推荐指数
1
解决办法
7874
查看次数

标签 统计

vb.net ×2

vb6-migration ×2

.net ×1

string-formatting ×1