Hi All,
I need to compare two strings one from data base and another generated during run time.
For Example In DB i have "The Cow is {0}"
Run time i am getting the string as "The Cow is White"
I need the result as equal. Thanks in advance.
Loading
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
Marjan Venema16 reputationPosted Apr 27, 2015, 1:52 AM EDT
You could try replacing any {0} (and {1}, {2}) with some RegEx and then trying to match the string you get at run time against that.
For example:
Please note, my RegEx skills are below par. And of course you would want to replace the replacements at the top with something more intelligent.
Cheers, Marjan
Marjan Venema16 reputationPosted Apr 25, 2015, 6:25 AM EDT
If that doesn't help, could you please clarify what you are trying to achieve and what pieces of information you have to work with?
Suthish NairRank #92 · 22.8K reputationPosted Apr 24, 2015, 11:19 AM EDT
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Apr 26, 2015, 9:23 AM EDT
Murugesh P85 reputationPosted Apr 26, 2015, 10:03 PM EDT