Table Designing:
TempId TempName Message
1 Fees Dear * your * is pending amount
Front end selected value in "*" D
How to this text in "*" only get it different value replace the data.
I want This result :
Dear John your 25000 is started pending amount


VulpesRank #55 · 29.2K reputationPosted Sep 9, 2014, 6:33 AM EDT
using System.Text.RegularExpressions;
// ...
The output, as expected, is:
Dear John your 25000 is pending amount
Nitesh KejriwalRank #253 · 9.9K reputationPosted Sep 9, 2014, 6:06 AM EDT
Nitesh KejriwalRank #253 · 9.9K reputationPosted Sep 9, 2014, 6:43 AM EDT
VulpesRank #55 · 29.2K reputationPosted Sep 9, 2014, 7:37 AM EDT
You could still do it using:
message.IndexOf('*', startIndex)
to get successive positions of the asterisks but regular expressions are neater :)
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 9, 2014, 8:48 PM EDT
Hi,
We can also use string.format function but for that we have to change in in input string...
string message = "Dear {0} your {1} is pending amount";
string[] replacements = {"John", "25000"};
string newstring = String.Format(message,replacements);
hope this will help you.
Nirmal KumarCRank #6,413 · 267 reputationPosted Sep 10, 2014, 12:14 AM EDT
Your information very helpful sir.
Thank you sir.
Nirmal KumarCRank #6,413 · 267 reputationPosted Sep 10, 2014, 12:14 AM EDT
Your information very helpful sir.
Thank you sir.