Z
Zytan
I am surprised that a single character string is not auto-created from
a single char. It is hard to find information on converting a char
into a string, since most people ask how to convert char[] to string.
I have a function that accepts a string, and I wish to access this
function for each character in the string, individually. The only
solution I have found is:
char c = 'A';
string s = System.Text.Encoding.ASCII.GetString(c);
But, using the Encoding functions??? This seems so wrong, since it
doesn't have to convert anything. I could get demons from this, since
it could change the underlying 16-bit value stored within the char.
ASCII isn't good enough. Default uses the default code page, whatever
that may be. What can I do to ensure 100% that it stays the same?
Debug.Assert(s[0] == c);
Zytan
a single char. It is hard to find information on converting a char
into a string, since most people ask how to convert char[] to string.
I have a function that accepts a string, and I wish to access this
function for each character in the string, individually. The only
solution I have found is:
char c = 'A';
string s = System.Text.Encoding.ASCII.GetString(c);
But, using the Encoding functions??? This seems so wrong, since it
doesn't have to convert anything. I could get demons from this, since
it could change the underlying 16-bit value stored within the char.
ASCII isn't good enough. Default uses the default code page, whatever
that may be. What can I do to ensure 100% that it stays the same?
Debug.Assert(s[0] == c);
Zytan