[MatchEvaluator] new MatchEvaluator(MatchReplace(comment mettre un argument))
Bjr,
j'ai un
Code:
MatchEvaluator myEvaluator = new MatchEvaluator(MatchReplace);
et
Code:
1 2 3 4 5 6 7 8 9
| private static string MatchReplace(Match m)
{
if (m.Value[0] == '1')
return "1:" + GetDateYyyymmdd();
if (m.Value[0] == '2')
return "2:" + GetDateYyyymmdd();
else
return m.Value;
} |
est ce possible de passer un argument a MatchReplace ?
genre un truc:
Code:
MatchEvaluator myEvaluator = new MatchEvaluator(MatchReplace(value, "blah"));
Code:
1 2 3 4 5 6 7 8 9
| private static string MatchReplace(Match m, string s)
{
if (m.Value[0] == '1')
return "1:" + GetDateYyyymmdd();
if (m.Value[0] == '2')
return "2:" + GetDateYyyymmdd();
else
return m.Value;
} |
merci