code: public static String processSimpleMacros(String input, Object[] args)
      {
          if (input == null || input.isEmpty() || args.length == 0)
          {
              return input;
          }
  
          StringBuilder out = new StringBuilder();
  
          int stringIndex = 0;
          int argIndex = 0;
          int len = input.length();
          char current;
          char next;
  
          while (stringIndex < len)
          {
              current = input.charAt(stringIndex);
              if (current == ESCAPE && stringIndex + 1 < len)
              {
                  next = input.charAt(stringIndex + 1);
                  if (next == ESCAPE || next == MACRO_BEGIN)
                  {
                      stringIndex++;
                      out.append(next);
                  }
                  else
                  {
                      out.append(current);
                  }
              }
              else if (current == MACRO_BEGIN && stringIndex + 1 < len)
              {
                  next = input.charAt(stringIndex + 1);
                  if (next == MACRO_END && argIndex < args.length)
                  {
                      stringIndex++;
                      out.append(args[argIndex++]);
                  }
                  else
                  {
                      out.append(current);
                  }
              }
              else
              {
                  out.append(current);
              }
  
              stringIndex++;
          }
  
          return out.toString();
      }
docs: Processes simple {} macros by inserting values from args with the matching index.
  If more macros than arguments exist, additional macros will not be replaced.
  
  @param input the message
  @param args  the arguments
  
  @return the processed message