🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #550

Re: C# 2.0

#550
From: Jon Shemitz
Date: Mon, 26 Jul 2004 17:52
24 lines
1792 bytes
"Rudy Velthuis [TeamB]" wrote:

> > public static string Replace(string Input, Regex R, string Pattern)
> > {
> >   // Create an object[] with an entry for every capture group in R
> >   object[] Groups = new object[R.GetGroupNumbers().Length];
> >
> >   // Pass Regex.Replace a C# 2.0 anonymous method
> >   return R.Replace(Input, delegate(Match M)
> >   {
> >     M.Groups.CopyTo(Groups, 0);
> >     return String.Format(Pattern, Groups);
> >   } );
> > }

> I personally don't see the need for anonymous methods, but that's
> just me.

As an exercise, rewrite the anonymous method in C# 1.0 ... or D8.

-- 

programmer, author  http://www.midnightbeach.com
and father          http://www.midnightbeach.com/hs
Technical Details
Message-ID: <410544E2.B48A179C@midnightbeach.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40FE138D.D0A0F368@midnightbeach.com> <41049F97.B701E290@midnightbeach.com> <xn0dl8annr622006-moderator@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,169d36351e297cad
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <410544E2.B48A179C@midnightbeach.com>
Date: Mon, 26 Jul 2004 10:52:34 -0700
From: Jon Shemitz <jon@midnightbeach.com>
Reply-To: jon@midnightbeach.com
Organization: Midnight Beach
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en-US,en
MIME-Version: 1.0
Newsgroups: borland.public.csharpbuilder.language.csharp
Subject: Re: C# 2.0
References: <40FE138D.D0A0F368@midnightbeach.com> <41049F97.B701E290@midnightbeach.com> <xn0dl8annr622006-moderator@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 63.249.65.27
X-Trace: newsgroups.borland.com 1090864356 63.249.65.27 (26 Jul 2004 10:52:36 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail