MCPcopy Create free account
hub / github.com/Var3D/var3dframe / join

Method join

core/src/core/java/var3d/net/center/json/JSONArray.java:555–566  ·  view source on GitHub ↗

Returns a new string by alternating this array's values with separator. This array's string values are quoted and have their special characters escaped. For example, the array containing the strings '12" pizza', 'taco' and 'soda' joined on '+' returns this: "12\" pizza"+"taco"+"soda"</p

(String separator)

Source from the content-addressed store, hash-verified

553 * <pre>"12\" pizza"+"taco"+"soda"</pre>
554 */
555 public String join(String separator) throws JSONException {
556 JSONStringer stringer = new JSONStringer();
557 stringer.open(JSONStringer.Scope.NULL, "");
558 for (int i = 0, size = values.size(); i < size; i++) {
559 if (i > 0) {
560 stringer.out.append(separator);
561 }
562 stringer.value(values.get(i));
563 }
564 stringer.close(JSONStringer.Scope.NULL, JSONStringer.Scope.NULL, "");
565 return stringer.out.toString();
566 }
567
568 /**
569 * Encodes this array as a compact JSON string, such as:

Callers

nothing calls this directly

Calls 6

openMethod · 0.95
valueMethod · 0.95
closeMethod · 0.95
appendMethod · 0.45
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected