如何批量去除代码内的所有注释?Remove.exe批量去除代码注释

写注释是一个非常好的习惯,但是某些情况下,我们又不想保留代码里的注释,于是就有了下面这个小软件(大小仅1.6m)。

点击此处下载:https://nicen.cn/collect/remove.exe

Remove.exe

一个批量去除代码内所有注释的小工具,支持去除C家族系列的单行和多行注释,比如下面这种:

/* 多行注释 */
// 单行注释

1.使用说明

双击运行exe文件,将会弹出如下的窗口界面:

如何批量去除代码内的所有注释?Remove.exe批量去除代码注释

点击选择代码目录,选择需要去除注释的项目目录,之后会弹出第二个窗口,如下:

如何批量去除代码内的所有注释?Remove.exe批量去除代码注释

选择需要排除的文件或目录,然后输入需要移除注释的文件的格式类型,点击运行:

如何批量去除代码内的所有注释?Remove.exe批量去除代码注释

耐心等待处理结束。

移除注释之前,记得备份一份带注释的源文件,代码无价,慎重操作😂

原文:https://nicen.cn/6043.html

C代码注释删除工具,用Lex生成。可删除C源程序中的/* xxxx */的块或单行注释,及C++风格的单行注释,对于常量字符串中出现的注释不清除。文件包含Lex代码及编译的Linux下的可执行文件。编译及使用见Readme。 C注释的类型如下 // /* // * "C-style block comment be removed // * C-style block comment be removed" // * C-style block comment be removed // */ // // /* C-style single line comment be removed */ // // // c++ comment be removed // // ///* c++ comment be removed */ // c++ comment be removed // // // c++ comment enclosed with double-quote untouched // "////*\"c++ comment enclosed with double-quote untouched\" ##*/\n" // // // c-style single line comment enclosed with double-quote untouched // "/*c-style multiple line comment enclosed with double-quote untouched*/\n" // // // c-style multiple line comment enclosed with double-quote untouched // "/** c-style multiple line comment enclosed with double-quote untouched \n\ // \n next line\ // */\n" 示例文件: int main() { /* * "C-style block comment be removed * C-style block comment be removed" * C-style block comment be removed */ /* C-style single line comment be removed */ int foo; /* C-style single line comment be removed */ /* C-style single line comment be removed */ int bar; int foobar; /* "C-style block comment be removed C-style block comment be removed C-style block comment be removed */ // c++ comment be removed ///* c++ comment be removed */ // c++ comment be removed // "////" ???? // "/*test file */" ????? /* ssss /* dddd */ printf("////*\"c++ comment enclosed with double-quote untouched\" ##*/\n"); // c++ comment enclosed with double-quote untouched printf("/*c-style multiple line comment enclosed with double-quote untouched*/\n"); // c-style single line comment enclosed with double-quote untouched // printf("/** test cmnt \n //\n ss //*/"); printf("/** c-style multiple line comment enclosed with double-quote untouched \n\ \n next line\ */\n"); // c-style multiple line comment enclosed with double-quote untouched } 注释删除后成为: int main() { int foo; int bar; int foobar; printf("////*\"c++ comment enclosed with double-quote untouched\" ##*/\n"); printf("/*c-style multiple line comment enclosed with double-quote untouched*/\n"); printf("/** c-style multiple line comment enclosed with double-quote untouched \n\ \n next line\ */\n"); }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值