最佳答案
不幸的是,alignment
不能是一个变量。 alignment
必须是常量表达式。这是来自 docs 的相关部分
alignment: The constant expression whose value defines the minimum number of characters in the string representation of the result of the interpolated expression. If positive, the string representation is right-aligned; if negative, it's left-aligned. For more information, see Alignment Component.
关于c# - 字符串插值中的变量对齐组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51524619/