P
Peteroid
The following code:
char x_char = '0' ;
String^ x_str = c_char.ToString( ) ;
results in:
x_str = = "48"
and not:
x_str == "0"
[NOTE: the ASCII code for char('0') is int(48)]
MS is aware of this, and has given no guarantees it will ever be fixed.
ToString( ) also has worse problems with char arrays according to a filed
bug report (which says it always returns the exact same string:
"String.Char[]", and MS replied that to modify this behavior would be a
breaking change. HUH? Links after signature if interested in reading about
it).
Help! I need the following function:
String^ Char_To_String( char c )
{
// ???
}
That if given c == '0' returns "0". Thanks for responses! : )
[==P==]
The links to the bug reports:
http://lab.msdn.microsoft.com/produ...edbackid=788dfe28-0ac8-4c5f-96c2-bb5065fd7c2b
http://lab.msdn.microsoft.com/produ...edbackid=8e62476e-599a-44cf-81db-d6a026770ad3
char x_char = '0' ;
String^ x_str = c_char.ToString( ) ;
results in:
x_str = = "48"
and not:
x_str == "0"
[NOTE: the ASCII code for char('0') is int(48)]
MS is aware of this, and has given no guarantees it will ever be fixed.
ToString( ) also has worse problems with char arrays according to a filed
bug report (which says it always returns the exact same string:
"String.Char[]", and MS replied that to modify this behavior would be a
breaking change. HUH? Links after signature if interested in reading about
it).
Help! I need the following function:
String^ Char_To_String( char c )
{
// ???
}
That if given c == '0' returns "0". Thanks for responses! : )
[==P==]
The links to the bug reports:
http://lab.msdn.microsoft.com/produ...edbackid=788dfe28-0ac8-4c5f-96c2-bb5065fd7c2b
http://lab.msdn.microsoft.com/produ...edbackid=8e62476e-599a-44cf-81db-d6a026770ad3