Why are those two string returning different values for length. "CertificateKey" is a property. It returns 41 for length. However, the equivalent constant string returns 40. If I copy the value of certificate as a constant, the length returns 41. Why?!?
// This is the property. Length 41
CertificateKey.Length
41
// This is a constant of the same string. Length 40
"9FE90CA8A4138F65E9E2C67D1F37B9D5B9919384".Length
40
// This is a copy of the value of the property above. Length 41
"9FE90CA8A4138F65E9E2C67D1F37B9D5B9919384".Length
41
I copied and pasted your two string literals into LINQPad and found that I could reproduce your result, so then I printed each character like so:
var a = "9FE90CA8A4138F65E9E2C67D1F37B9D5B9919384";
var b = "9FE90CA8A4138F65E9E2C67D1F37B9D5B9919384";
foreach (char c in a) Console.WriteLine($"{(int)c:X}");
Console.WriteLine("---");
foreach (char c in b) Console.WriteLine($"{(int)c:X}");
And got the following result:
39
46
[...]
34
---
200E
39
46
[...]
34
200E is the left-to-right mark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With