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?
 
Back
Top