【问题标题】:Formatting declaration of constant strings常量字符串的格式化声明
【发布时间】:2014-03-12 07:26:31
【问题描述】:

是否有可能格式化常量?转这个

public const string SHORT_CONST = "MyShortConst";
public const string QUITE_LONG_CONST = "MyQuiteLongConst";

进入这个

public const string SHORT_CONST      = "MyShortConst";
public const string QUITE_LONG_CONST = "MyQuiteLongConst";

【问题讨论】:

  • 看看这个thread。不过可能已经过时了

标签: c# refactoring resharper


【解决方案1】:

您是否尝试过为 Visual Studio 使用 Code alignment 扩展,这将允许您在 = 上对齐

【讨论】:

  • 相当不错,用“=”对齐几乎正是我所需要的。
【解决方案2】:

两者都是有效代码,只是当您在行尾键入; 时,您的编辑器可能会自动证明测试的正确性

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-21
    • 2017-07-07
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-28
    相关资源
    最近更新 更多