I am working on strings in .Net Core. I have a string formatted using :n, and when it is formatted, output 123 456,00. I would like to argue that the formatted string is equal to the string I want, but I get Assert.Equal Failure(), and the problem is the space character. At the exit, he claims that the two spaces are different.
Here is my code:
public void Separator()
{
var str = string.Format("{0:n}", 123456);
Assert.Equal("123 456,00",str);
}
I also compared the space character from the formatted string with the regular space character with the statement as follows Assert.Equal(' ',str[3]);to get the expected value 0x00a.
Why is this happening and how can I get the same character without using string.Format()?