code: public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
      if (separator == null) {
        return null;
      }
  
      int numInputBytes = 0;  // total number of bytes from the inputs
      int numInputs = 0;      // number of non-null inputs
      for (int i = 0; i < inputs.length; i++) {
        if (inputs[i] != null) {
          numInputBytes += inputs[i].numBytes;
          numInputs++;
        }
      }
  
      if (numInputs == 0) {
        // Return an empty string if there is no input, or all the inputs are null.
        return EMPTY_UTF8;
      }
  
      // Allocate a new byte array, and copy the inputs one by one into it.
      // The size of the new array is the size of all inputs, plus the separators.
      final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
      int offset = 0;
  
      for (int i = 0, j = 0; i < inputs.length; i++) {
        if (inputs[i] != null) {
          int len = inputs[i].numBytes;
          copyMemory(
            inputs[i].base, inputs[i].offset,
            result, BYTE_ARRAY_OFFSET + offset,
            len);
          offset += len;
  
          j++;
          // Add separator if this is not the last input.
          if (j < numInputs) {
            copyMemory(
              separator.base, separator.offset,
              result, BYTE_ARRAY_OFFSET + offset,
              separator.numBytes);
            offset += separator.numBytes;
          }
        }
      }
      return fromBytes(result);
    }
docs: Concatenates input strings together into a single string using the separator.
  A null input is skipped. For example, concat(",", "a", null, "c") would yield "a,c".