string concatenation with %s

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 7 08:44:19 PST 2015


Suliman:

> I need to construct complex SQL request, like:
>
> string sql = ("INSERT INTO test.geomagnetic (`date`, 
> `a_fredericksburg`, `fredericksburg`, `a_college`, `college`, 
> `a_planetary`, `planetary`) VALUES ('%s', '%s', '%s', '%s', 
> '%s', '%s', '%s');", date[i], a_fredericksburg[i], 
> fredericksburg[i], a_college[i], college[i], a_planetary[i], 
> planetary[i]);
>
>
> I except that writefln have some behavior as string 
> concatenation, but it does not.
>
> IS there any way to put needed values in place of %s in string?

Please show the _clean_ input, followed by an output example.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list