string message = "Hi Your Payment |payment| is Due on Date |date| , So Make Payment as soon as possible.";
now,
text between | and | is refer Column Name of Datatable, and i want to put data from datatable in it.
how can i ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Feb 17, 2015, 4:45 AM EST
Vasu GadhiyaRank #7,540 · 239 reputationPosted Feb 17, 2015, 6:25 PM EST
but Problem is in Message String,
User can enter its own message,
ex .
string message = "Hi Your Payment |payment| is Due on Date |date| , So Make Payment as soon as possible.";
string message = "Hello Mr. |CustomerName| Your Payment |payment| is Due.";
How To Substring Every Text Between |,| and get data from datatable.row[0].
thanks,
Vasu GadhiyaRank #7,540 · 239 reputationPosted Feb 17, 2015, 9:36 PM EST
first substring With | Like --> "Hi Your Payment", "Paymnet", "is Due on Date" ......
After I Substring Withing | --> "Payment", "Date" ....
Match Both Array and put in first array {0}, {1} .....
after i add as you shown..
Thanks,
VulpesRank #55 · 29.2K reputationPosted Feb 18, 2015, 5:57 AM EST
I've just quickly thrown together this console application to show you what I mean:
Console.WriteLine();
The output is: