MCPcopy Create free account
hub / github.com/Berkeley-CS61B/skeleton-sp23 / allAs

Method allAs

lab08/tests/speed/StringUtils.java:72–78  ·  view source on GitHub ↗

Returns a string of all 'a' of length LEN.

(int len)

Source from the content-addressed store, hash-verified

70
71 /** Returns a string of all 'a' of length LEN. */
72 private static String allAs(int len) {
73 StringBuilder sb = new StringBuilder();
74 for (int i = 0; i < len; i++) {
75 sb.append('a');
76 }
77 return sb.toString();
78 }
79
80 /** Returns true if S is all 'z'. False for empty strings */
81 public static boolean isAllzs(String s) {

Callers 1

nextStringMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected