Cannot implictly convert type 'char' to 'string'

  • Thread starter Thread starter Davor
  • Start date Start date
D

Davor

This is what I want to do:

int currentWord = 0;
currentWord++;
textBoxOtherLang.Text = orginalLanguage[currentWord];

But, I get a "Cannot implictly convert type 'char' to 'string'"
error when trying to do it. How do I fix it?

Thanks!

================
Davor Babic´
 
Hi Davor,

textBoxOtherLang.Text = orginalLanguage[currentWord].ToString();

or you can always use the Convert class:

textBoxOtherLang.Text = Convert.ToString( orginalLanguage[currentWord] );

the latter expression just call ToString() :)

Hope this help,
 
Davor said:
This is what I want to do:

int currentWord = 0;
currentWord++;
textBoxOtherLang.Text = orginalLanguage[currentWord];

But, I get a "Cannot implictly convert type 'char' to 'string'"
error when trying to do it. How do I fix it?

Well, what exactly are you trying to do? What is the type of
orginalLanguage, and what are you expecting to see on the screen?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top