I have a string .. let’s say:
string MyString = "SELECT Stuff FROM Table WHERE Code = "Foo" AND DATE=20120101";
I want to replace 20120101 with a ?. But, the 20120101 string I search for won’t always be the same. It will always start with a 2, and always contain 8 characters. It may be 20121225, 20130510, etc.
Can I use wildcards somehow? As in:
string Fixed = MyString.Replace("2*******", "?");
What I’m looking for is this result:
MyString = "SELECT Stuff FROM Table WHERE Code = "Foo" AND DATE=?";
Or alternatively, using a positive look-behind