C# 记录

1. 添加 icon

选择图片并转换成ico格式:https://convertio.co/zh/download/8441dcb3979589069571b8c7295903474957c6/

然后右键属性中添加icon

C# 记录

 

2. Regex的replace方法替换,实现首字母大写

        private void Add_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (Button)sender;
            btn_content = (String)btn.Content;
            if (total.Equals("") || total.EndsWith('!') || total.EndsWith('.') || total.EndsWith('?'))
            {
                // capitalize the first letter
                firstContent = btn_content[1].ToString().ToUpper();
                // original first letter that need to be replaced
                Regex regex = new Regex(btn_content[1].ToString());
                // only replace once
                btn_content = regex.Replace(btn_content, firstContent, 1);
            }
            total += btn_content;
            Result.Content = total;
        }

 

上一篇:Python 中判断输入是否为数字的实现代码


下一篇:【DB笔试面试717】在Oracle中,RAC的脑裂和健忘分别指的是什么?