有時候看源代碼掉伏,注釋太多了也很難受,如果能刪了豈不是最好澳窑。
用vim
:%s/\/\/\/.*//g
:g/\/\/\/.*/d
:g/^$/d
用shell
sed -i "xxxbak.swift" -e '/\/\/\/.*/d' -e '/^$/d' xxx.swift
或者xcode直接替換
/\*([^\*]|(\*)*[^\*/])*(\*)*\*/
(//.*)| \n|/\*([^\*]|(\*)*[^\*/])*(\*)*\*/|^\n
4千行除掉后斧散,剩下200+行, 果然很清凈