.empty [英] .empty

查看:78
本文介绍了.empty的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string.empty用于什么?


我不能说:if string.empty那么

我必须使用:if string =""然后


哪个好,我只想知道.empty的用途。

What is string.empty used for?

I can''t say: if string.empty then
I have to use: if string = "" then

which is ok, I just want to know what .empty is for.

推荐答案

CJ ,


有无穷无尽的方法可以判断字符串是否存在但是没有

包含任何字符。


其中一个是string.empy另一个字符串=""和string =没有

虽然初始化。


在这个新闻组中,一旦取得了字符串=""对于没有任何

字符的字符串。


但是我不会喋喋不休。唯一危险的一个可以是

string =什么都没有,因为那个测试以及预先没有的字符串没有

字符串(没什么)


我希望这会有所帮助,


Cor


" cj" < cj@nospam.nospam> schreef in bericht

news:uM ************** @ TK2MSFTNGP05.phx.gbl ...
CJ,

There are endless methods to tell that a string exist however does not
contain any character.

One of those is string.empy another one string="" and string=nothing
although that initializes.

In this newsgroup is once taken the string="" for the string without any
character.

However I would not botter to much. The only dangerous one can be the
string=nothing, because that test as well on a string that was in advance no
string (Is Nothing)

I hope this helps,

Cor

"cj" <cj@nospam.nospam> schreef in bericht
news:uM**************@TK2MSFTNGP05.phx.gbl...
什么是string.empty用于?

我不能说:if string.empty那么
我必须使用:if string =""那么没关系,我只是想知道.empty的用途。
What is string.empty used for?

I can''t say: if string.empty then
I have to use: if string = "" then

which is ok, I just want to know what .empty is for.



" cj" < cj@nospam.nospam> schrieb:
"cj" <cj@nospam.nospam> schrieb:
string.empty用于什么?

我不能说:if string.empty那么
我必须使用:if string = ""然后

这是好的,我只是想知道.empty的用途。
What is string.empty used for?

I can''t say: if string.empty then
I have to use: if string = "" then

which is ok, I just want to know what .empty is for.




\\\

如果x = String.Empty则

...

结束如果

///

在语义上相当于


\\\

如果x =""然后

...

结束如果

///


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http: //classicvb.org/petition/>



\\\
If x = String.Empty Then
...
End If
///

is semantically equivalent to

\\\
If x = "" Then
...
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


使用String.Empty将字符串初始化为零长度。


Dim s作为字符串

s = String.Empty


要检查字符串是否为零长度,请检查长度属性。


如果s.Length = 0那么

''...

结束如果

http://www.gotdotnet.com/team/fxcop/...ingLength。 HTML

-

======================

Clive Dixon

Digita Ltd.( www.digita.com

" cj" < cj@nospam.nospam>在消息中写道

news:uM ************** @ TK2MSFTNGP05.phx.gbl ...
Use String.Empty to initialise strings to zero-length.

Dim s As String
s = String.Empty

To check whether a string is zero length, check the Length property.

If s.Length = 0 Then
''...
End If

http://www.gotdotnet.com/team/fxcop/...ingLength.html
--
======================
Clive Dixon
Digita Ltd. (www.digita.com)
"cj" <cj@nospam.nospam> wrote in message
news:uM**************@TK2MSFTNGP05.phx.gbl...
什么是string.empty用于?

我不能说:if string.empty那么
我必须使用:if string =""那么没关系,我只想知道.empty的用途。
What is string.empty used for?

I can''t say: if string.empty then
I have to use: if string = "" then

which is ok, I just want to know what .empty is for.



这篇关于.empty的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆