Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ToString in VB.NET code in ASP.NET Web Page
Message
De
17/11/2009 09:50:07
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
17/11/2009 07:31:19
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
Database:
Visual FoxPro
Divers
Thread ID:
01435079
Message ID:
01435189
Vues:
49
>>>I don't believe it will go this easy in C# due to the stronger typing. This is one of those differences beween C# and VB that Bill Kuhn was telling me about.
>>>
>>>Cecil
>>>
>>>>Because you're using the integer in a string concatenation, I think .NET handles the .ToString for you automagically. I know, it seems like it shouldn't do that conversion for you like that, but I guess for a simple string concatenation it will do that.
>>>
>>>>~~Bonnie
>>
>>
>>The fact is that string concatenation knows that all elements must be string and does an implicit conversion for you. However, best practice is to use the StringBuilder class for concatenating strings.
>
>For such an example - I would not use StringBuilder
>
>http://www.yoda.arachsys.com/csharp/stringbuilder.html
>
>and
>http://weblogs.asp.net/bleroy/archive/2005/01/07/348831.aspx

For 1 simple concat, neither would I, but regardless, best practice is to use StringBuilder.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform