C# string interpolation with variable format

后端 未结 6 1631
时光取名叫无心
时光取名叫无心 2021-01-18 06:15

I need to format a variable with string interpolation, and the format string is another variable:

here is my sample code:

static void Main(string[] a         


        
6条回答
  •  醉酒成梦
    2021-01-18 07:00

    The string interpolation happens in the compilation stage. You cannot use variables in the format strings because of that.

提交回复
热议问题