Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to convert string to char?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
How to convert string to char?
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01321885
Message ID:
01321885
Vues:
57
Hi everybody,

This is very simple quick question. I created a char property called PersonType. I also have a string letterCode (it declared a string, but it is actually one letter character).

How can I do
this.PersonType = letterCode ;

I tried this.PersonType = (char) letterCode; but this didn't work.

Thanks in advance.

UPDATE. Took a minute break and the answer came to me.

this.PersonType = Convert.ToChar(letterCode);
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform