A
Alan Silver
Hello,
<dumb question>
I am trying to do something similar to the following...
string str = "Hello";
char c = (char)str.Substring(2,1);
but the compiler complains that it cannot convert a string to a char.
How do I do this? I know that c will only be one character long, so it
can be converted to a char, but the compiler doesn't know that.
If it's of any help, I'm converting it to a char in order to get the
ASCII value, so if there's an easier way of converting a one-character
substring of a string to an int, please tell me.
Thanks
</dumb question>
<dumb question>
I am trying to do something similar to the following...
string str = "Hello";
char c = (char)str.Substring(2,1);
but the compiler complains that it cannot convert a string to a char.
How do I do this? I know that c will only be one character long, so it
can be converted to a char, but the compiler doesn't know that.
If it's of any help, I'm converting it to a char in order to get the
ASCII value, so if there's an easier way of converting a one-character
substring of a string to an int, please tell me.
Thanks
</dumb question>