JensAyton / JATemplate

String formatting that’s convenient and less evil than printf-style formatting.
30 stars 1 forks source link

Default option to coerce BOOL "toString". #12

Open mralexgray opened 10 years ago

mralexgray commented 10 years ago

I usually just do something like...

JATExpand(@"I want to say \"{0|if:YES;NO}\".", _boolDesire);

which expands to...

I want to say "YES".

I tried to figure out how to add an option such as...

JATExpand(@"I want to say \"{0|toString}\".", _boolDesire);

but it's all so complicated, my head spun.

Any advice on how to fold in this kind of functionality? Thanks, Alex.