Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EMPTY() in VB.NET
Message
From
01/12/2004 07:14:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/12/2004 03:36:13
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00965987
Message ID:
00966020
Views:
6
>Hi all!
>
>One short question - what is equal to the vfp function EMPTY() in VB.Net?
>
>If I use Textbox1.Text.Equals(String.Empty) 0 would have to be checked separately.
>
>Thanks for help!

There are many ways. And you should decide what's empty. String.Empty is 0 length string not like VFP's empty(). To get something like (actually better) than VFP's empty() you'd use Trim():

C#:
// 0 length string
bool isempty = (Textbox1.Text.Length == 0);
bool isempty = (Textbox1.Text == String.Empty);
bool isempty = (Textbox1.Text.CompareTo(String.Empty) == 0);

// check removing white space
bool isempty = (Textbox1.Text.Trim() == String.Empty);
bool isempty = (Textbox1.Text.Trim().CompareTo(String.Empty) == 0);

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform