Hi again folks,
If I have a String object as in -
I can write the following -Code:String myString = "ABCDEF";
and it will compile, outputting C to the console.Code:Console.WriteLine(myString1[2]);
That's all well and good, but what I'd like to be able to do is something like -
But I get the following error when I try to compile the program -Code:myButton.Text = myString[2];
Cannot implicitly convert type 'char' to 'string'
I've tried casting the char to a string as in -
but that does not work eitherCode:String myNewString = (String)(myString[2]);
The word "implicitly" in the error I receive leads me to believe that what I'm trying to do is possible, but I've just got the syntax wrong, am I correct in that assumption?
Can anyone show me how to get this working? Thank you.





Reply With Quote