I know that with {{ and }} we can avoid curly braces in C #. But they do not work well if they are right after the format modifier (for example, {0:F6} ).
string str; // Prints "{3.14}" as expected str = string.Format("{{{0}}}", 3.14); Console.WriteLine(str); // Expected "{3.140000}", found "{F6}" str = string.Format("{{{0:F6}}}", 3.14); Console.WriteLine(str);
source share