string message = TxtMsg.Text;
string[] replacements = { $StudentName$, $CrsDate$,$PendingAmount$ };
MatchCollection mc = Regex.Matches(message, @"\*");
int limit = Math.Min(mc.Count, replacements.Length) - 1;
for (int i = limit; i >= 0; i--)
{
message = message.Remove(mc[i].Index, 1).Insert(mc[i].Index, replacements[i]);
}
TxtMsg.Text = message.ToString();
I want This result :
Dear John your 25000 is started pending amount
Thank You