MCPcopy Index your code
hub / github.com/processing/processing / countLines

Method countLines

app/src/processing/app/Util.java:41–47  ·  view source on GitHub ↗

Get the number of lines in a file by counting the number of newline characters inside a String (and adding 1).

(String what)

Source from the content-addressed store, hash-verified

39 * characters inside a String (and adding 1).
40 */
41 static public int countLines(String what) {
42 int count = 1;
43 for (char c : what.toCharArray()) {
44 if (c == '\n') count++;
45 }
46 return count;
47 }
48
49
50 /**

Callers 1

getLineCountMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected