Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of question mark in parameters
Message
De
07/11/2011 16:46:01
 
 
À
07/11/2011 16:14:11
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01528240
Message ID:
01528313
Vues:
54
>I'd use the string.IsNullOrEmpty() method instead:
>
>
>        Public Function GetNonNullable(ByVal tcValue As String) As String
>            Dim lcValue As String= ""
>
>            ' If we have a value
>            If Not string.IsNullOrEmpty(tcValue) Then
>                lcValue = tcValue
>            End If
>
>            Return lcValue
>        End Function
>
Declaration already has the variable set to empty. I initialize all my declarations to empty values. So, the only check needed after is to make sure it is not null to put the value in it. That will be in the condition. But, thanks for an alternative way to do it.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform