🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: C# 2.0

#549
From: Rudy Velthuis [TeamB]
Date: Mon, 26 Jul 2004 12:07
28 lines
1973 bytes
At 08:07:19, 26.07.2004, Jon Shemitz 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);
>   } );
> }
> 
> // substitute the {number} syntax of String.Format 
> // for the $number syntax of Match.Result
> 
> // give Rudy and Nick heart attacks.

Not me. I personally don't see the need for anonymous methods, but that's
just me.
-- 
Rudy Velthuis [TeamB]

"Every day I get up and look through the Forbes list of the richest
people in America. If I'm not there, I go to work."
    - Robert Orben
Technical Details
Message-ID: <xn0dl8annr622006-moderator@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,169d36351e297cad
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Rudy Velthuis [TeamB]" <velthuis@gmail.com>
Subject: Re: C# 2.0
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <40FE138D.D0A0F368@midnightbeach.com> <41049F97.B701E290@midnightbeach.com>
Organization: TeamB
User-Agent: XanaNews/1.16.3.1
Date: Mon, 26 Jul 2004 14:07:38 +0200
Message-ID: <xn0dl8annr622006-moderator@newsgroups.borland.com>
X-Realname: Rudy Velthuis (TeamB)
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr
 p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
X-Ref: newsgroups.borland.com ~XNS:00004221
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.93.140.35
X-Trace: newsgroups.borland.com 1090843363 217.93.140.35 (26 Jul 2004 05:02:43 -0700)
Lines: 28
X-Authenticated-User: rvelthuis
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail