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 14:28:59
 
 
À
17/11/2009 13:00:49
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:
01435266
Vues:
39
>Hi,
>
>Just realized that my reply to Charles had nothing to do with the question :-}
>I think the true answer is that the String class must have an operator overload for type Object that returns a new string with Object.ToString() appended. Silly e.g.:
public class MyClass
>    {
>        public override string ToString()
>        {
>            return "World";
>        }
>    }
then:
string s1 = "Hello ";
>            s1 = s1 + new MyClass();
>
>>>


That's what I was thinking too

something like
public static implicit operator string(object obj)
		{
			return obj.ToString();
		}
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform