小编Ale*_*nov的帖子

git for-each-ref with <pattern> 不返回任何内容

git Branch --list ' hotfix '返回分支名称中包含单词 'hotfix' 的分支列表,而 git for-each-ref --format='%(authorname)' ' hotfix '不返回任何内容,甚至不返回/n符号

git git-branch

4
推荐指数
1
解决办法
3930
查看次数

字符串的长度不是我期望的

下面的方法产生意外的输出:

public static void Main(string[] args)
    {
        var dict = new Dictionary<int, string>()
        {
            {       2, "0000 0000 0000 0000 0000 0000 0000 0010".Replace(" ", "") },
            {       0, "0000 0000 0000 0000 0000 0000 0000 0000".Replace(" ", "") },
            { 7529548, "0000 0000 ?0111 0010 1110 0100 0100 1100?".Replace(" ", "") }
        };

        foreach(var pair in dict)
        {
            Console.WriteLine(pair.Value.Length);
        }
        Console.ReadKey();
    }
Run Code Online (Sandbox Code Playgroud)

输出为: 32、32、34

如果我使用编译器设置,它也不会改变。

为什么会发生这种情况?为什么在最后一种情况下字符串长度可能不同?

c# string dictionary

-4
推荐指数
1
解决办法
54
查看次数

标签 统计

c# ×1

dictionary ×1

git ×1

git-branch ×1

string ×1