Can I declare constant integers with a thousands separator in C#?

前端 未结 2 565
醉话见心
醉话见心 2021-01-07 18:50

The Cobra programming language has a useful feature where you can use underscores in numeric literals to improve readability. For example, the following are equivalent, but

2条回答
  •  星月不相逢
    2021-01-07 19:41

    Yes you can do this with C # 7.0 as shown here

    public const long BillionsAndBillions = 100_000_000_000;
    

提交回复
热议问题