Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert string to char?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
How to convert string to char?
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01321885
Message ID:
01321885
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform