title: How to remove a character from output string by *printf() function family using formats?
body: <p>How to remove a character from output string by *printf() function family using formats? it's possible? </p>
  
  <p>from macros this macros:</p>
  
  <pre><code>  char *s =
      g_strdup_printf(
      "insert into foo(name,serie,"
  #define X(a, b) #a ","
      LIST ") "
  #undef X
  #define X(a, b) "%d,"
      "values('%s'," LIST "%d" ")",
  #undef X
  #define X(a, b) bol-&gt;a,
      boletim-&gt;aname, serie, LIST
  #undef X
              );
  </code></pre>
  
  <p>I get output something like this:</p>
  
  <pre><code>  char *s =
      g_strdup_printf(
      "insert into foo(name,serie,"
  
      "red" "," "blue" "," "yellow" "," "purple" "," ") "
  
  
      "values('%s'," "%d," "%d," "%d," "%d," "%d" ")",
  
  
      boletim-&gt;aname, serie, boletim-&gt;red, boletim-&gt;blue, boletim-&gt;yellow, boletim-&gt;purple,
  
        );
  </code></pre>
  
  <p>A <code>puts(s)</code> call prints the following:</p>
  
  <pre><code>insert into foo(name,serie,red,blue,yellow,purple,) values('Ari tol',-1,-1,-1,-1,0)
  </code></pre>
  
  <p>But I have a problem, the <code>,</code> before first <code>)</code> that turns the SQL query invalid. I'm looking for some way to remove it from string. Maybe by some format that can be used in <code>printf()</code> functions family or re-define the macros. I don't know. It's just a try to don't write routines that search for index first of <code>)</code> and after another call to a string-replace function by index.</p>