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
string s1 = "database is <>.";
string s2a = "db";
string s2b = "PSFDVLP"
(then do some magical code)
System.Console.Writeline(s1);
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 BejaouiPosted Dec 8, 2008, 10:11 AM
StringBuilder oSb = new StringBuilder();
oSb.Append("database is <
oSb.Replace("<
Bechir BejaouiPosted Dec 10, 2008, 3:54 PM
Jeff JohnsonPosted Dec 8, 2008, 1:58 PM
The label between the << and >> can vary wildly, so I would need a generic replacement as was suggested by the first reply.
Thanks! Jeff
Samer iPosted Dec 8, 2008, 12:18 PM
Jeff JohnsonPosted Dec 8, 2008, 10:32 AM
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