Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: C# Text Replacement
|
Posted: Sep 19, 2003 3:03 PM
|
|
It would be even simpler to create a template that looks like this:
Dearest, Loviest {0},
Just wanted to send you a reimbursement for the dinner when my former pal happened by and mentioned my wife and thirteen half-witted children. Please find enclosed a money order for ${1}. Don't worry, the welt on my cheek is barely noticeable any more.
{2}ly yours,
{3} {4} {5}
{3}
Then you just use string.Format(), like this:
string letter = string.Format( letterTemplate, recipient, mealPrice, signoff, sender, senderSt, senderLocation );
Of course, you can configure the granularity of information as you choose.
|
|