I\'m trying not to use the \',\' char as a thousand separator when displaying a string, but to use a space instead. I guess I need to define a custom culture, but I don\'t s
There's a slightly simpler version of Jon Skeet one :
using System;
using System.Globalization;
class Test
{
static void Main()
{
NumberFormatInfo nfi = new NumberFormatInfo {NumberGroupSeparator = " ", NumberDecimalDigits = 0};
Console.WriteLine(12345678.ToString("n", nfi)); // 12 345 678
}
}
And the 'nfi' initialization could be skipped and put directly as parameter into the ToString() method.