MCPcopy Create free account
hub / github.com/antlr/codebuff / count

Method count

src/org/antlr/codebuff/Tool.java:494–502  ·  view source on GitHub ↗
(String s, char x)

Source from the content-addressed store, hash-verified

492 }
493
494 public static int count(String s, char x) {
495 int n = 0;
496 for (int i = 0; i<s.length(); i++) {
497 if ( s.charAt(i)==x ) {
498 n++;
499 }
500 }
501 return n;
502 }
503
504 public static String expandTabs(String s, int tabSize) {
505 if ( s==null ) return null;

Callers 5

getPrecedingNLMethod · 0.95
formatMethod · 0.95
emitCommentsToTheLeftMethod · 0.95

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected