How to count lines of Java code using IntelliJ IDEA?

前端 未结 9 499
慢半拍i
慢半拍i 2020-12-07 09:25

How to count lines of Java code using IntelliJ IDEA?

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 10:00

    To find all including empty lines of code try @Neil's solution:

    Open Find in Path (Ctrl+Shift+F)

    Search for the following regular expression: \n'

    For lines with at least one character use following expression:

    (.+)\n
    

    For lines with at least one word character or digit use following expression:

    `(.*)([\w\d]+)(.*)\n`
    

    Notice: But the last line of file is just counted if you have a line break after it.

提交回复
热议问题