Before I write a byte for byte search and subsitute routine, does anyone know if there is an easy way to do this? I want to take
Code
string s1 = "database is >.";Code
string s2a = "db";Code
string s2b = "PSFDVLP"Code
(then do some magical code)Code
System.Console.Writeline(s1);Code
and get the result: "database is PSFDVLP."This is a simplified case, I'll actually have 2 arrays of substitute variables/values that I need to swap out when a substitute variable is within "<<" and ">>".
Thanks.Jeff

Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 8, 2008, 5:11 AM EST
StringBuilder oSb = new StringBuilder();
oSb.Append("database is <
oSb.Replace("<
Jeff Johnson34 reputationPosted Dec 8, 2008, 5:32 AM EST
I figured there must be an easier way. Thanks for the quick response. I'll give that a shot tonight when I get home from the office.
Jeff
Samer i4 reputationPosted Dec 8, 2008, 7:18 AM EST
Jeff Johnson34 reputationPosted Dec 8, 2008, 8:58 AM EST
The label between the << and >> can vary wildly, so I would need a generic replacement as was suggested by the first reply.
Thanks! Jeff
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 10, 2008, 10:54 AM EST