public static String substitute(String message, String... args) {
        byte[] bytes = getBytes(message);
        int length = bytes.length;
        int argIndex = 0;
        int argCount = args.length;
        int argBytesLength = 0;
        for (String str : args) {
            argBytesLength += str == null
                    ? 2
                    : str.length() - 2;
        }
        byte[] newBytes = new byte[length + argBytesLength];
        int writeIndex = 0;
        byte b;
        byte[] argBytes;
        for (int i = 0; i < length; i++) {
            b = bytes[i];
            if (b == '{' && i < length - 1 && bytes[i + 1] == '}') {
                if (argIndex >= argCount) {
                    throw new IllegalArgumentException(
                            "The number of placeholder \"{}\" must be the same as the number of arguments");
                }
                argBytes = getBytes(String.valueOf(args[argIndex++]));
                System.arraycopy(argBytes, 0, newBytes, writeIndex, argBytes.length);
                writeIndex += argBytes.length;
                i++;
            } else {
                newBytes[writeIndex++] = b;
            }
        }
        if (writeIndex != newBytes.length) {
            throw new IllegalArgumentException(
                    "The number of placeholder \"{}\" must be the same as the number of arguments");
        }
        return newString(newBytes, LATIN1);
    }
@implNote 1. The strings must be ASCII and the method won't validate their coder for better
          performance.
          <p>
          2. The number of placeholder "{}" must equal the number of arguments, or its will
          throw. We don't support mismatch to avoid growing or shrinking the result string,
          or preprocess the message, which causes a bad performance while it can be avoided.
turms-server-common/src/main/java/im/turms/server/common/infra/lang/StringUtil.java