小编Sri*_*ist的帖子

在使用正则表达式替换时,如何保留匹配字符串的一部分?

我有

12.hello.mp3
21.true.mp3
35.good.mp3
.
.
.
Run Code Online (Sandbox Code Playgroud)

等等,作为文本文件中列出的文件名.

我需要用空格替换那些数字前面的点(.)(例如12.hello.mp3 => 12 hello.mp3).如果我将正则表达式设为"[0-9].",它也会替换数字.请帮我.

regex notepad++

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

如何从Windows内核编程开始?

我是一名应用程序开发人员,主要在C#工作.我对C/C++有一些了解.我非常着迷并对windows Kernel Development感兴趣.我勾勒出一个布局来学习这个.

1. Understand Windows internals(By books)
2. Try Simple Modules and keep expanding.
Run Code Online (Sandbox Code Playgroud)

为实现这一目标,我需要一些帮助:

1. The books I should read.
2. The Websites I should follow.
3. Setting up my dev environment.(Most important as I can start realizing.)
Run Code Online (Sandbox Code Playgroud)

请帮助.

kernel windows-kernel

17
推荐指数
1
解决办法
2万
查看次数

Visual Studio 名称如何控制?

当一个按钮被拖放到 WinForms 设计器上时,它会自动具有名称button1,下一个将是button2. 这是如何运作的?有没有办法改变默认的命名行为?

我的全部目的是获取 colFieldName 而不是 gridColumn1 然后更改其字段名称。对此有何建议?

c# windows-forms-designer winforms

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

如何在c#中打印方法的地址?

在C编程中,

void foo()
{
}
void main()
{
  printf("%p",foo);
}
Run Code Online (Sandbox Code Playgroud)

将打印foo函数的地址.如果C#中有一种方法可以实现相同的目的,请告诉我.

c c#

0
推荐指数
1
解决办法
2138
查看次数

将列表转换为字典(键的映射和筛选的列表作为值)

class Animal
    {
        public FoodTypes Food { get;set;} 
        public string Name { get; set; }
    }
    enum FoodTypes
    {
        Herbivorous,
        Carnivorous
    }

    class Util
    {
        public static Dictionary<FoodTypes,List<Animal>> GetAnimalListBasedOnFoodType(List<Animal> animals)
        {
            Dictionary<FoodTypes, List<Animal>> map = new Dictionary<FoodTypes, List<Animal>>();
            var foodTypes = animals.Select(o => o.Food).Distinct();
            foreach(var foodType in foodTypes)
            {
                if (!map.ContainsKey(foodType))
                    map.Add(foodType, null);
                map[foodType] = animals.Where(o => o.Food == foodType).ToList();
            }
            return map;
        }
    }
Run Code Online (Sandbox Code Playgroud)

上面的代码是为了了解我想要实现的目标.现在,问题是 是否有可能在单个lambda表达式中实现GetAnimalListBasedOnFoodType的功能?

c# lambda c#-4.0

0
推荐指数
1
解决办法
1800
查看次数