MCPcopy Create free account
hub / github.com/careercup/ctci / encode

Method encode

java/Chapter 17/Question17_10/QuestionOO.java:6–10  ·  view source on GitHub ↗
(String v, StringBuffer sb)

Source from the content-addressed store, hash-verified

4public class QuestionOO {
5
6 public static void encode(String v, StringBuffer sb) {
7 v = v.replace("0", "\\0");
8 sb.append(v);
9 sb.append(" ");
10 }
11
12 public static void encodeEnd(StringBuffer sb) {
13 sb.append("0");

Callers 1

encodeToStringMethod · 0.95

Calls 4

encodeEndMethod · 0.95
appendMethod · 0.80
getNameCodeMethod · 0.80
getTagCodeMethod · 0.45

Tested by

no test coverage detected