C#:查找所有空的捕获块 [英] C#: Find all empty catch blocks

查看:38
本文介绍了C#:查找所有空的捕获块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看一些代码.

我注意到一些空的捕获块.这不是一个好主意,因为某些功能不起作用,您也看不到原因.

I have notice some empty catch blocks. Not a good idea since somethings do not work and you cannot see why.

是否有一种简单的方法来找到解决方案中所有空的try catch块?

Is there an easy way to find all empty try catch blocks in a solution?

推荐答案

使用全局查找对话框,打开正则表达式,然后搜索:

Use use the global find dialog, turn on regular expressions and then search for:

catch:b*\([^)]*\):b*\{:b*\}

这篇关于C#:查找所有空的捕获块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆