删除VB6-isms,我被卡住了 [英] Removing VB6-isms, I'm stuck
问题描述
我目前正在开发一个VB.NET项目,该项目已经花费了相当多的时间。
过去它已经开发出了很多兼容性VB6函数
和
常量,例如Left(),LCase()和vbCr
虽然目前无法移植到C#,但我试图删除这些
函数和常量的使用。
但是ares a为了简单起见,一些代码说:
myString2 =替换(myString,vbCr,vbCrLf)
到目前为止,我已将此转换为:
myString2 = myString.Replace(vbCr,Environment.NewLine)
但是我该用什么代替vbCr?
问候,
彼得
Hi,
I am currently working on a VB.NET project that has been going for quite a
while.
In the past it has been developed with a lot of compatibility VB6 functions
and
constants, e.g Left(), LCase() and vbCr
Whilst not currently able to port to C# I am trying to remove usage of these
functions and constants.
However theres a bit of code that for simplicities sake says:
myString2 = Replace(myString, vbCr, vbCrLf)
So far I have converted this to:
myString2 = myString.Replace(vbCr, Environment.NewLine)
However what do I replace vbCr with?
Regards,
Peter
推荐答案
" Peter Row" < fuck.off@bastard_spammers.com> schrieb:
"Peter Row" <fuck.off@bastard_spammers.com> schrieb:
我目前正在开发一个相当长的VB.NET项目。
过去它已经开发了很多兼容性VB6
函数和
常量,例如Left(),LCase()和vbCr
这些方法是/不是/兼容库的一部分。
myString2 = myString.Replace(vbCr,Environment.NewLine)
然而我该用什么代替vbCr?
I am currently working on a VB.NET project that has been going for quite a
while.
In the past it has been developed with a lot of compatibility VB6
functions and
constants, e.g Left(), LCase() and vbCr
These methods are /not/ part of the compatibility library.
myString2 = myString.Replace(vbCr, Environment.NewLine)
However what do I replace vbCr with?
我更喜欢''ControlChars.Cr'',这是一个VB.NET功能。
-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://classicvb.org/petition/>
>
VB6字符串函数很快就会消失吗?我仍然发现自己使用
因为vbCr比ControlChars.Cr更短更容易。
" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道
news:uu ************** @ tk2msftngp13.phx.gbl ...
Are the VB6 string functions going away soon? I still find myself using
them because vbCr is much shorter and easier then ControlChars.Cr.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
" Peter Row" < fuck.off@bastard_spammers.com> schrieb:
"Peter Row" <fuck.off@bastard_spammers.com> schrieb:
我目前正在开发一个相当长的VB.NET项目。
过去它已经开发了很多兼容性VB6
函数和
常量,例如Left(),LCase()和vbCr
I am currently working on a VB.NET project that has been going for quite
a while.
In the past it has been developed with a lot of compatibility VB6
functions and
constants, e.g Left(), LCase() and vbCr
这些方法是/不是/兼容库的一部分。
These methods are /not/ part of the compatibility library.
myString2 = myString.Replace(vbCr,Environment.NewLine)
但是我用什么替换vbCr?
myString2 = myString.Replace(vbCr, Environment.NewLine)
However what do I replace vbCr with?
我更喜欢''ControlChars.Cr'',这是一个VB.NET功能。
- MS Herfried K. Wagner
MVP< URL:http:// dotnet。 mvps.org/>
VB< URL:http://classicvb.org/petition/>
I prefer ''ControlChars.Cr'', which is a VB.NET feature.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Terry Olsen写道:
Terry Olsen wrote:
VB6字符串函数很快就会消失吗?我仍然发现自己用
使用它们因为vbCr比ControlChars.Cr更短更容易。
Are the VB6 string functions going away soon? I still find myself using them because vbCr is much shorter and easier then ControlChars.Cr.
做一个进口Microsoft.VisualBasic.ControlChars你可以使用只是
Cr,甚至更短! :)
-
Larry Lard
回复团体请
Do an Imports Microsoft.VisualBasic.ControlChars and you can use just
Cr, which is even shorter! :)
--
Larry Lard
Replies to group please
这篇关于删除VB6-isms,我被卡住了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!