Je voulais utiliser le SmartEnumerable de Jon Skeet pour boucler un Regex.Matches
mais cela ne fonctionne pas.SmartEnumerable et Regex.Matches
foreach (var entry in Regex.Matches("one :two", @"(?<!\w):(\w+)").AsSmartEnumerable())
Quelqu'un peut-il m'expliquer pourquoi? Et proposez une solution pour le faire fonctionner. Merci.
L'erreur est:
'System.Text.RegularExpressions.MatchCollection' does not contain a definition
for 'AsSmartEnumerable' and no extension method 'AsSmartEnumerable' accepting
a first argument of type 'System.Text.RegularExpressions.MatchCollection' could
be found (are you missing a using directive or an assembly reference?)
Comment ça ne marche pas? –